/ 科创班 /

记录详情

Time Exceeded

/in/foo.c: In function 'main':
/in/foo.c:16:13: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
 if (c >= 'a'&&c <= 'z' || c >= 'A'&&c <= 'Z')
     ~~~~~~~~^~~~~~~~~~
# 状态 耗时 内存占用
#1 Time Exceeded ≥1068ms ≥256.0 KiB
#2 Time Exceeded ≥1003ms ≥256.0 KiB
#3 Time Exceeded ≥1065ms ≥176.0 KiB
#4 Time Exceeded ≥1065ms ≥180.0 KiB
#5 Time Exceeded ≥1066ms ≥256.0 KiB
#6 Time Exceeded ≥1063ms ≥256.0 KiB
#7 Time Exceeded ≥1068ms ≥256.0 KiB
#8 Time Exceeded ≥1064ms ≥256.0 KiB
#9 Time Exceeded ≥1003ms ≥256.0 KiB
#10 Time Exceeded ≥1004ms ≥256.0 KiB

代码


#include <stdio.h>

int main()

{

char c;

int letters=0,space=0,digit=0,other=0;

while ((c=getchar())!='\n')

{

if (c >= 'a'&&c <= 'z' || c >= 'A'&&c <= 'Z')

{

letters++;

}

else if (c == ' ')

{

space++;

}

else if (c >= '0'&&c <= '9')

{

digit++;

}

else

{

other++;

}

}

printf("%d\n%d\n%d\n%d\n",letters,space,digit,other);

return 0;

}

信息

递交者
类型
递交
题目
5.4统计字符个数
题目数据
下载
语言
C
递交时间
2018-07-18 20:03:32
评测时间
2018-07-18 20:03:32
评测机
分数
0
总耗时
≥10474ms
峰值内存
≥256.0 KiB