正在加载图片...
char text[l= ["The programming language c was originally developed by Dennis Ritchie of Bell Laboratories and was designed to run on a PDP-11 with a UNIX operating system.) main()… .(1分) int i,j, upp, low, digit, space, otheri upp=low=digit=space=other=0 for(i=0;1<3;i++ (1分) for(j=0;<80text[i][j]!=\0′;j++)… (2分) if(text[i][j]>=A′&&text[i][j]<=′2) (1分) else if(text[i][j]>=a'&& text[i][j]<=z).(1) 1ow++ else if(text[i][j>=0′text[i][j]<=9′)…(1分) digit++ else if(text[i][j] (1分) space++ (1分) other++ printf(upper case: 8d\n", upp) printf("lower case: 8d\n", low)i printf(" digit:岩d、n", digit) printf("space: &d\n", space) printf(other: d\n",other (1分char * text[]= {”The programming language C was originally developed ”, ”by Dennis Ritchie of Bell Laboratories and was designed ”, ”to run on a PDP-11 with a UNIX operating system.”}; main()……………………………………………………………………………………………………………………(1 分) { int i,j,upp,low,digit,space,other; upp=low=digit=space=other=0; for(i=0;i<3;i++)……………………………………………………………………………………(1 分) for(j=0;j<80 && text[i][j]!=’\0’;j++)………………………(2 分) { if(text[i][j]>=’A’ && text[i][j]<=’Z’)………………(1 分) upp++; else if(text[i][j]>=’a’ && text[i][j]<=’z’)…(1 分) low++; else if(text[i][j]>=’0’ && text[i][j]<=’9’)…(1 分) digit++; else if(text[i][j]==’ ’)……………………………………………………(1 分) space++; else…………………………………………………………………………………………………………(1 分) other++; } printf(”upper case: %d\n”,upp); printf(”lower case: %d\n”,low); printf(”digit: %d\n”,digit); printf(”space: %d\n”,space); printf(”other: %d\n”,other);…………………………………………………(1 分) }
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有