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

题目内容 (请给出正确答案)

请读程序片段(字符串内没有空格字符):printf("%d\n",stlen("ATS\n012\1\ \”)); 上面程序片段的输出结果是 ( )

A.11

B.10

C.9

D.8


参考答案

更多 “ 请读程序片段(字符串内没有空格字符):printf("%d\n",stlen("ATS\n012\1\ \”)); 上面程序片段的输出结果是 ( )A.11B.10C.9D.8 ” 相关考题
考题 以下程序的输出结果是 【 10 】 。#include string.hmain( ){ printf("%d\n",strlen("IBM\n012\1\\"));}

考题 以下程序的输出结果是_____.# includemain(){ printf(“%d\n”,strlen(“IBM\n012\1\\”));}

考题 下列给定程序中,函数fun()的功能是:将字符串p中所有字符复制到字符串b中,要求每复制3个字符之后插入一个空格。例如,在调用fun()函数之前给字符串a输入ABCDEFGHIJK,调用函数之后,字符串b中的内容则为ABC DEF GHI JK。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <stdio. h>void fun (char *p, char *b){ int i, k=0;while (*p)/*************found***************/{ i=l;/*************found***************/while (i<3|| *P){b[k]=*p;k++; p++; i++;}if (*p)/*************found***************/{ b[k]= ' ';}}b[k]= '\0';}main ( ){ char a[80],b[80];printf ("Enter a string: "); gets (a);printf ("The original string: ");puts (a);fun (a,b);printf("\nThe string after insertspace: "); puts(b); printf("\n\n ");}

考题 请编写函数proc,该函数的功能是:将放在字符串数组中的M个字符串(每串的长度不超过N),按顺序合并组成一个新的字符串。 例如,若字符串数组中的M个字符串为: ABCD BCDEFG CDEFGHI 则合并后的字符串内容应该是ABCDBCDEFGCDEF—GHl。 注意:部分源程序给出如下。 请勿改动main函数和其他函数中的任何内容,仅在函数proc的花括号中填人所编写的若干语句。 试题程序: includestdio.h includeconio.h define M 3 define N 20 void proc(char arr[M][N],char*b) {} void main { char str[M][N]={"ABCD","BCDEFG"," CDEFGHI"},i; char arr[100]={" "); printf("The string:\n"); for(i=0;iM;i++) puts(str[i]); printf("\n"); proc(str,arr); printf("The A string:\n"); printf("%s",arr); printf("\n\n"); }

考题 若x是int型变量,且有下面的程序片段: for(x=3;x<6;x++)printf(x%2)?("* *%d"):(”# #%d\n”),x); 上面程序片段的输出结果是 ( )A.* * 3 # # 4 * * 5B.# # 3 * * 4 # # 5C.# # 3 * * 4 # # 5D.* * 3 # # 4 * * 5

考题 请读程序:includemain(){int a,b; for(a = 1,b = 1 ;a=20)break;if 请读程序: #include <stdio.h> main() { int a,b; for(a = 1,b = 1 ;a <= 100;a++) { if(b>=20) break; if(b%3 ==1) { b +=3;continue; } b-=5; } printf("%d\n",a); } 上面程序的输出结果是( )。A.7B.8C.9D.10

考题 读下面程序段(字符串内没有空格字符): printf("%d\n",strlen("ATS\n012\1\\"));其输出结果是( )。A.11B.10C.9D.8

考题 有以下程序: #includestdio.h #includestrin9.h main( ) {printf{"%d\n",strlen("%d\n",strlen("ATS\n012\|"));} 程序运行后的输出结果是( )。A.3B.8C.4D.9

考题 设有以下程序片段:char a[ ]="hello",*p;p=a;printf("%d",*(p+5));执行上面的程序片段后的结果为( ) A.111B.0C.104D.不确定的值

考题 以下程序用以删除字符串中所有的空格,请填空。 include main() {char s[100]={"Our teac 以下程序用以删除字符串中所有的空格,请填空。include<stdio.h>main(){char s[100]={"Our teacher teach C language!"};int i,j;for(i=j=0;s[i]!='\0';i++)if(s[i]!=''){( )}s[j]='\0';printf("%s\n",s);}

考题 请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符串的最后,把第m+1到最后的字符移到字符串的前部。例如,字符串中原有的内容为ABCDEFGHIJK,m的值为 3,移动后,字符串中的内容应该是DEFGHIJKABC。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include <stdio. h>include <string.h>define N 80void fun (char *w, int m){}main ( ){char a[N]= "ABCDEFGHIJK";int m;printf ("The origina string : \n");puts (a);printf("\n\nEnter m: ");scanf ("%d", m);fun (a, m);printf (" \nThe string after moving : \n");puts (a);printf ("\n\n");}

考题 以下程序用以删除字符串中所有的空格,请填空。

考题 请读程序片段: int i=65536;printf("%d”\n”,i; 上面程序片段的输出结果是 ( )A.65536B.0C.有语法错误,无输出结果D.-l

考题 有以下程序#include stdio.h#include string.hmain( ){ printf("%d\n",strlen ("ATS\n012\1") ); }程序运行后的输出结果是A)3B)8C)4D)9

考题 请读程序: include main( ) { int n[2],i,j,k; { for(i=0,i 请读程序: # include<srdio.h> main( ) { int n[2],i,j,k; { for(i=0,i<2;i + + )n[i]=0; k=2; for(i=0;i<k;i+ +) {for(j=0;j<k;j+ +)n[j]=n[i]+l; print{("%d\n",n[k]); } 上面程序片段输出结果是 ( )A.不确定的值B.3C.23D.1

考题 以下程序:includemain(){char str[10];scanf("%s",str);printf("%s\n",str);}运 以下程序: #include<stdio.h> main() {char str[10]; scanf("%s",str); printf("%s\n",str); } 运行上面的程序,输入字符串how are you,则程序的执行结果是( )。A.howB.how are youC.hD.howareyou

考题 str是全部由小写字母字符和空格字符组成的字符串,由 num传入字符串的长度。请补充函数fun(),该函数的功能是:统计字符串str中的单词个数,结果由变量num传回。每个单词之间都由空格隔开,并且字符串str开始不存在空格。例如:str=“how do you do”,结果为:num=4。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include <stdio.h>define N 80void fun(char *s,int *num){int i,n=0;for(i=0;【 】;i++){if(s[i]>='a',s[i]<='z',(s[i+1)==’’||s[i+1]=='\0'))【 】;}【 】;}main(){char str[N];int num=0;printf("Enter a string:\n");gets(str);while(str[num])num++;fun(str,num);printf("The number of word is:%d\n\n",num);

考题 请读程序:includemain(){int a,b;for(a=1,b=1;a=20)break;if(b%3=1”{ 请读程序: #include<stdio.h> main() { int a,b; for(a=1,b=1;a<=100:a++){ if(b>=20)break; if(b%3=1”{b+=3;continue;} b=5; } printf("%d\n",A) ; } 上面程序的输出结果是_______。A.7B.8C.9D.10

考题 请读程序片段(字符串内没有空格字符): printf("%d\n",strlen("ATS\n012\1\\"));上面程序片段的输出结果是_______。A.11B.10C.9D.8

考题 有以下程序:includestdio.hincludestrin9.hmain( ){printf{%d\n,strlen(%d\n,strlen(ATS\n012\|));}程序运行后的输出结果是( )。A.3B.8C.4D.9

考题 请读程序: includemain(){int num=0;while(num 请读程序: # include<stdio.h> main( ) {int num=0; while(num<=2) {num+ +;printf("%d\n",num);} } 上面程序的输出结果是 ( )A.1B.1 2C.1 2 3D.1 2 3 4

考题 若x和y都是int型变量,x=100,y=200,且有程序片段:printf("%d",(x,y)); 上面程序片段的输出结果 ( )A.200B.100C.100 200D.输出格式符不够,输出不确定的值

考题 若k是int型变量,且有下面程序片段: k=-3; if(k 若k是int型变量,且有下面程序片段: k=-3; if(k<=0)printf("# # # #") else printf(" ") 上面程序片段的输出结果是 ( )A.# # # #B. C.# # # D.有语法错误,无输出结果

考题 请读程序片段(字符串内没有空格):printf(%d/n,strlen(ATS/n012/1//));的输出结果是()A、11B、10C、9D、8

考题 请读程序: main() {inta=1,b=2; printf("%d/n",a=a+1,a+6,b+2);} 则上面程序的输出结果是()A、2B、3C、4D、1

考题 单选题请读程序: main() {inta=1,b=2; printf("%d/n",a=a+1,a+6,b+2);} 则上面程序的输出结果是()A 2B 3C 4D 1

考题 单选题请读程序片段(字符串内没有空格):printf(%d/n,strlen(ATS/n012/1//));的输出结果是()A 11B 10C 9D 8