| ||||||||||
| 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 | |||||||||
哪里错了,help help!#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
float m;
int array[50];
int w=0;
while (scanf("%f",&m)==1)
{
if(m==0.00) break;
else
{
float total=0;
int n=2;
do
{
total=total+(1/n);
n++;
}while(total<m);
array[w++]=(n+1);
}
}
int v=0;
for(;v<(w+1);v++)
printf("%d",array[v]);
system("PAUSE");
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator