Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
框架是对的,可是为什么第二个数就重复上面了,循环出的错吧,大家帮帮忙#include<iostream> using namespace std; int main() {int i=2,j=0,k; float len=0; float length[100]; int count=0; for(j;;j++) {cin>>length[j]; if(length[j]==0.00) break; } for(k=0;k<j;k++) { for(i=2;len<length[k];i++) { len+=1.00/i; count++; } if(length[k]>=0.01&&length[k]<=5.2) cout<<count<<" card(s)"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator