ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1283. Dwarf

Why the answer is wrong???
Posted by Kamaldinov Dmitry 13 Oct 2012 22:18
#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;
}