level 1
无聊去写诗
楼主
#include <stdio.h>
#define IN 1 /*zaidancine*/
#define OUT 0 /*GFSG*/
/*sdb */
main ()
{
int c , nl , nw , nc , state;
state = OUT ;
nl = nw =nc = 0;
while (( c = getchar()) != EOF ) {
++nc;
if (c == '\n')
++ nl ;
if ( c == ' '|| c == '\n' || c == '\t')
state = OUT ;
else if (state == OUT ) {
state = IN ;
++nw;
}
}
printf ("%d %d %d\n", nl, nw, nc);
}
为什么这个程序在c-free中可以运行 错误代码:
(: error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int)得怎么改?搞了一晚上了,,
2014年04月24日 13点04分
1
#define IN 1 /*zaidancine*/
#define OUT 0 /*GFSG*/
/*sdb */
main ()
{
int c , nl , nw , nc , state;
state = OUT ;
nl = nw =nc = 0;
while (( c = getchar()) != EOF ) {
++nc;
if (c == '\n')
++ nl ;
if ( c == ' '|| c == '\n' || c == '\t')
state = OUT ;
else if (state == OUT ) {
state = IN ;
++nw;
}
}
printf ("%d %d %d\n", nl, nw, nc);
}
为什么这个程序在c-free中可以运行 错误代码:
(: error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int)得怎么改?搞了一晚上了,,