填写注释语句#include main() { char string[81]; int i,num=0,word=0;
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/04/28 15:39:49
填写注释语句
#include
main()
{
char string[81];
int i,num=0,word=0;
char c;
gets(string);
for(i=0;(c=string[i])!='\0';i++)
if(c=='')word=0;
else if (word==0)
{
word=1;
num++;}
printf("There are %d words in the line.\n",num);
getch();
}
我是一个初学者,不太懂这个程序,希望大家帮忙
#include
main()
{
char string[81];
int i,num=0,word=0;
char c;
gets(string);
for(i=0;(c=string[i])!='\0';i++)
if(c=='')word=0;
else if (word==0)
{
word=1;
num++;}
printf("There are %d words in the line.\n",num);
getch();
}
我是一个初学者,不太懂这个程序,希望大家帮忙
#include
main()
{
char string[81];
int i,num=0,word=0;
char c; //初始化定义变量
gets(string); //读入string的值
for(i=0;(c=string[i])!='\0';i++)
if(c==' ')word=0;//判断当前的字符是不是空格
else if (word==0) //如果上一个字符是空格,下一个字符为一个单词的开头
{
word=1;
num++;} //这时单词数加一
printf("There are %d words in the line.\n",num+1);
//这里有误,帮你改正,因为第一个单词前面没有空格
getch();
}
main()
{
char string[81];
int i,num=0,word=0;
char c; //初始化定义变量
gets(string); //读入string的值
for(i=0;(c=string[i])!='\0';i++)
if(c==' ')word=0;//判断当前的字符是不是空格
else if (word==0) //如果上一个字符是空格,下一个字符为一个单词的开头
{
word=1;
num++;} //这时单词数加一
printf("There are %d words in the line.\n",num+1);
//这里有误,帮你改正,因为第一个单词前面没有空格
getch();
}
填写注释语句#include main() { char string[81]; int i,num=0,word=0;
#includevoid main(){char string[81];int i,num=0;word=0;char
#include #include void main() { char x[]="STRING"; x[0]=0; x
while语句问题.#include #include int main (void){int i,sum=0;puts
C语言 ACM#include #include int main(){int i=0,c=1,d=0;char str
#include main(){char s[]="012xyz\08s34f4w2"; int i,n=0; for(
#include main() { char s[]="12345678"; int v[4]={0,1,1,0},k,
#include main() { char *p[]={ "BOOL","OPK","H","SP"}; int i;
#include void main() { char i,m; while(i>5) { P1=0x22; m=P1>
#include void main() { int i;int sum=0; for(i=1;i
#include int main(){int i,j,k;for (i=0;i
#include void main(){int a[30];int i;for (i=0,i