|
|
back to boardWhy the answer is wrong??? #include <iostream> using namespace std; int main() { int a, c, b, year; double a1, b1, c1; cin >> a >> b >> c; a1=static_cast <double>(a); if(a1<=1024*1024*1024*2-1 && b<=1024*1024*1024*2-1 && c>=1 && c<=100 && a>0 && b>0) { for(year=1; a1=a1*(100-c)/100; year++) { if (a1<=b) { cout << year; break; } } } cin.get(); cin.get(); return 0; }
|
|
|