网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
下面程序的功能是()。include include using namespace std;int main (){ in

下面程序的功能是( )。 #include <iostream> #include <string> using namespace std; int main () { int i=1, n=0; char s[80],*p; p=s; strcpy(p,"It is a book.."); for (; *p !=' \0' ;p++) { if(*p=='') i=0; else if (i==0) { n++; i=1; } } cout<<"n=" <<n<<end1; return 0; }

A.统计字符串中的单词个数

B.统计字符串中的空格个数

C.统计字符串中的字母个数

D.统计字符串中的全部字符个数


参考答案

更多 “ 下面程序的功能是()。include include using namespace std;int main (){ in 下面程序的功能是( )。 #include <iostream> #include <string> using namespace std; int main () { int i=1, n=0; char s[80],*p; p=s; strcpy(p,"It is a book.."); for (; *p !=' \0' ;p++) { if(*p=='') i=0; else if (i==0) { n++; i=1; } } cout<<"n=" <<n<<end1; return 0; }A.统计字符串中的单词个数B.统计字符串中的空格个数C.统计字符串中的字母个数D.统计字符串中的全部字符个数 ” 相关考题
考题 下面程序错误的语句是①include ②void main( 0③{④int * p = new int[1] ;⑤p =9;⑥co 下面程序错误的语句是 ①#include < iostream.h> ②void main( 0 ③{ ④ int * p = new int[1] ; ⑤ p =9; ⑥ cout <<*p <<end1; ⑦ delete [ ] p; ⑧ }A.④B.⑤C.⑥D.⑦

考题 下面程序错误的语句是 ① include ② void main( ) ③ { ④ int * p=new int[1] ; ⑤ p 下面程序错误的语句是① #include<iostream.h>② void main( )③ {④ int * p=new int[1] ;⑤ p=9;⑥ cout < < * p < <endl;⑦ delete[ ] p;⑧ }A.④B.⑤C.⑥D.⑦

考题 下面程序的输出结果是()。includeinclude"string.h"void main(){char a[]="Hello T 下面程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<end1; } A) B)C) D)A.HelloB.TestC.Hello TestD.Hello Test HelloTest

考题 下面程序的运行结果是( )。include main(){int a=25; fun(A); }fun(int *x){ print 下面程序的运行结果是( )。include<stdio.h>main(){int a=25;fun(A);}fun(int *x){ printf("%d\n",++*x);}

考题 下面程序错误的语句是 #include"iostream.h" ① void main() ② { ③ int A=0; ④ int&B; ⑤ B=A; ⑥ cout<<B; ⑦ cout<<A; ⑧ }A.②B.③C.④D.⑥

考题 下面程序的运行结果是 ( ) include include main( ) { char * a=" 下面程序的运行结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char * a="AbcdEf",* b="aBcD" a + +;b + +; printf("%d\n",strcmp(a,b)); }A.0B.负数C.正数D.无确定值

考题 下面程序错误的语句是①include ②void main()③{④int * p=new int[1]⑤p=9⑥cout 下面程序错误的语句是①#include<iostream.h>②void main()③{④ int * p=new int[1]⑤ p=9⑥ cout<<* p<<end1;⑦ delete []p;⑧}A.④B.⑤C.⑥D.⑦

考题 当执行下面的程序时,如果输入ABC,写出程序输出结果 #include "stdio.h" #include "string.h" main() { char ss[10]; gets(ss); strcat(ss,"6789"); printf("%sn",ss); }

考题 分析下面程序的运行结果()。 #include "stdio.h" #include "string.h" main() { printf("%dn",strlen("IBMn012")); }

考题 【填空题】下面程序的运行结果是 。 #include<stdio.h> #include<string.h> main() {char a[20]="AB",b[20]="LMNP"; int i=0;strcat(a,b); while(a[i++]!='0') b[i]=a[i]; puts(b); }