|
|
вернуться в форумTest #10 Послано levani 22 июл 2014 04:03 I got WA 10, where is wrong? /////////////////////// #include <iostream> using namespace std; int main() { int N,M,sum,counter,mul; counter=0; cin>>N>>M; sum=M; mul=N*M; while(sum!=mul) { N--; sum+=N; counter++; if(sum==mul) break; M--; sum+=M; counter++; } cout<<counter<<endl; } |
|
|