![](https://lstatic.shangxueba.com/jiandati/h5/images/m_q_title.png)
有以下程序:include<stdio.h> include<string.h>main{ char x[]="STRING"
有以下程序:
include<stdio.h>
include<string.h>
main
{ char x[]="STRING";
x[0]=0;x[1]=\0;x[2]=0;
printf("%d %d\n",sizeof(x),strlen(x));
}
程序运行后的输出结果是()。
A.6 1
B.7 0
C.6 3
D.7 1
有以下程序:
include<stdio.h>
include<string.h>
main
{ char x[]="STRING";
x[0]=0;x[1]=\0;x[2]=0;
printf("%d %d\n",sizeof(x),strlen(x));
}
程序运行后的输出结果是()。
A.6 1
B.7 0
C.6 3
D.7 1
A.654321
B.116611
C.161616
D.l23456
A、循环执行10次
B、循环是无限循环
C、循环体语句一次也不执行
D、循环体语句执行一次
A、B
B、b
C、98
D、m
运行程序输入adebdwe↙和d↙,写出输出结果。 #include <string.h> #include <stdio.h> int main() { char c , t[50]; int len,j,k; gets(t); c=getchar(); len = strlen(t); for (k=0; k <len; k++) if (t[k]="=c)" {j="k;" break;} else j="-1;" printf("%d",j); return 0;>
有以下程序
#include
#include
main()
{ char a[5][10]={“china”, “beijing”, “you”, “tiananmen”, “welcome”};
int i,j; char t[10];
for(i=0; i<4; i++)
for(j=i+1; j<5; j++)
if(strcmp(a[i], a[j])>0)
{ strcpy(t, a[i]); strcpy(a[i],a[j]); strcpy(a[j], t);}
puts(a[3]);
}
程序运行后输出结果是()
A.beijing
B.china
C.welcome
D.tiananmen
#include
#include
void fun (char *str )
{ char temp;int n,i;
n=strlen (str ) ;
temp=str[n-1];
for (i=n-1;i>0;i-- ) str[i]=str[i-1];
str[0]=temp;
}
main ()
{ char s[50];
scanf (" %s " ,s ) ; fun (s ) ; printf (" %s\n " ,s ) ;}
程序运行后输入: abcdef< 回车 > ,则输出结果是 【 12 】 。
A、6
B、7
C、8
D、9
B、7,5,6
C、7,6,5
D、5,6,7
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!