F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_20610353_11406.cpp: In function 'int main()':
0_0_20610353_11406.cpp:4:80: error: expected '}' at end of input
     using namespace std;double mon,downpay,loan,dep;double rate[110];int main(){   // freopen("in","r",stdin);    while(cin >> mon >> downpay>>loan>>dep&&mon>0){        memset(rate,0.0,sizeof rate);        while(dep--){            int s;            double ra;            cin >> s >> ra;            for(int i = s; i <= 100; i++) rate[i] = ra;        }        int ans = 0;        double aver = loan/mon;        double nowloan = loan;        double nowsum = (loan+downpay)*(1-rate[0]);        while(nowsum < nowloan){            ans++;            nowloan -= aver;            nowsum = nowsum*(1-rate[ans]);        }        cout<<ans<<" ";        if(ans != 1) cout<<"months"<<endl;        else cout<<"month"<<endl;     }     return 0;}
                                                                                ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-01-12 18:51:53, Gzip enabled