杭电ACM 2030怎么Output Limit Exceeded 了http://acm.hdu.edu.cn/showproblem.php?pid=2030
#include<stdio.h>
#include<string.h>
void main()
{
char a[1000];
int n,flge,i;
while(scanf("%d",&n)!=EOF)
{
getchar();
while(n--)
{
flge=i=0;
gets(a);
while(a[i++]!='\0')
{
if(a[i]<0)
{
flge++;
i++;
}
}
printf("%d\n",flge);
}
}
}
Output Limit Exceeded (OLE) :
Your program tried to write too much information. This usually occurs if it goes into a infinite loop.
不知道你的代码是否改过、没做修改直接贴上去就ac了;
温馨提示:内容为网友见解,仅供参考
第1个回答 2011-04-29
已AC。
#include<stdio.h>
#include<string.h>
void main()
{
char a[1000];
int n,flge,i;
scanf("%d",&n);
getchar();
while(n--)
{
flge=i=0;
gets(a);
while(a[i++]!='\0')
{
if(a[i]<0)
{
flge++;
i++;
}
}
printf("%d\n",flge);
}
}
Warning: Invalid argument supplied for foreach() in /www/wwwroot/aolonic.com/skin/templets/default/contents.html on line 45
相似回答