标签:else namespace tick div for pac code color span
1 //贪心,注意特判即可 2 #include <iostream> 3 using namespace std; 4 int main() 5 { 6 int a,b,ans = 0; 7 cin >> a >> b; 8 while(a+b > 1 && (a != 1 || b != 1) && (a!=0 && b!=0)) 9 { 10 ++ans; 11 if(a > b) {a -= 2; b+=1;} 12 else {a+=1; b-=2;} 13 } 14 cout << ans << endl; 15 return 0; 16 }
标签:else namespace tick div for pac code color span
原文地址:http://www.cnblogs.com/qq188380780/p/7265941.html