| ||||||||||
| 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>
#include<stdio.h>
using namespace std;
int main()
{
float a[100];
float s;
int k(1),n(1);
cin>>a[0];
for(int i=1;a[i-1]!=0;i++)
{
cin>>a[i];
}
for(int j=0;a[j]!=0;j++)
{
s=0;
for(int k=1;s<a[j];k++)
{
s=s+1.0/(k+1);
}
cout<<k-1<<" 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