|
|
back to boardWA №3 Why? This is my solution: #include <iostream> using namespace std; int main(){ long int a,b,f=0; long int k=1; cin>>a>>b; if (a==1) { f=0; cout<<f; return 0;
}
if (b>=a && a<=2) f=1;
else if(a!=1){ while (k<=b){ f++; k*=2;
} a -=k; while (a>0){ f++; a=a-b;
} } cout<<f;
return 0; } Re: WA №3 Posted by AzizIO 17 Oct 2012 03:59 Some test for your program 10 1 ans 9 3 8 ans 2 Re: WA №3 Some test for your program 10 1 ans 9 3 8 ans 2 Спасибо, помогло=) |
|
|