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(){ double n; double a[10]; int i; int p=0; for(i=0;i<10;i++) {cin>>a[i]; if(a[i]==0.00) break; } while(a[p]){ double k=0; for(n=1;k<a[p];n++){ k+=1.00/(n+1); } cout<<n-1<<' '<<"card(s)"<<endl; p++; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator