更多“有以下程序 #include <stdio.h> int i; int len(char *s) { while(*s++){ i++; } return i”相关的问题
第1题
#include <stdio.h> long fun(char s[]) { int i,j,n=0; for(i=j=0;s[i]!='\0';i++) { if(s[i]!='n') { s[j]= s[i]; j++; } if(s[i]>= '0'&& s[i]<= '9') n="n*10+" s[i]- '0'; } s[j]="\0" ; return n; void main( ) { char str[]="m12or3nin456g" long printf("n="%ld"," n); 运行程序的输出结果是:____>
点击查看答案
第2题
有以下程序
#include
int fun(char s[])
{int n=0;
while(*s<='9'&&*s>='0'){n=10*n+*s-'o';s++;)
return(n);
}
main
{char s[10]={'6','1','*','4','*','9','*',' 0','*');
printf("%d",fun(s));
}
程序运行的结果是()。
A.9
B.61490
C.61
D.5
点击查看答案
第3题
以下程序的运行结果是______。 #include<stdio.h> #include<string.h> typedef struct{char name[9]; char sex; float score[2];} STU; void f(STU a) { STUb={"Zhao",'m',85.0,90.0}; int i; strcpy(a.name, b.name); a.sex=b.sex; for(i=0;i<2;i++)a.score[i]=b.score[i]; } main() { stuc="{"Qian",'f',95.0,92.0};" f(c);> A、Qian,f,95,92
B、Qian,m,85,90
C、Zhao,f,95,92
D、Zhao,m,85,90
点击查看答案
第4题
请根据程序中的注释,把程序补充完整 #include <stdio.h> struct student { char name[20]; double score; }; void prn(struct student *p); int main() { struct student s; scanf("%s%lf", s.name, &s.score); prn(&s); return 0; } void prn(struct student *p) { printf("%s, %.2f\n", ____________); //输出学生的姓名和成绩, }
点击查看答案
第5题
有以下程序#include<stdio.h>int fun(char s[]){int n=0;while(*s<='9'&&*s>
有以下程序
#include<stdio.h>
int fun(char s[])
{int n=0;
while(*s<='9'&&*s>='0'){n=10*n+*s-'o';s++;)
return(n);
}
main
{char s[10]={'6','1','*','4','*','9','*',' 0','*');
printf("%d",fun(s));
}
程序运行的结果是( )。
A.9
B.61490
C.61
D.5
点击查看答案
第6题
以下程序段运行后的输出结果是【 】. #include <string.h> int main() { char a[7]="AB"; char b[7]={'a','b','c','d'}; puts(strcat(b,a)); return 0; }
点击查看答案
第7题
#include< reg51.h>和#include" reg51.h",本质一样。
点击查看答案
第8题
re.split(r'<[^<]*?>','<h1>t</h1>
点击查看答案
第9题
有以下程序 struet STU { char name[10]; int num; int Score; }; main() { struct STU s[5]-{{"YangSan",20041,703},("LiSiGuo",20042,580}, {"WangYin",20043,680},{"SunDan",20044,550}, {"Penghua",20045,537}},*p[5],*t; int i,j; for(i=0;i<5;i++) p[i]-&s[i]; for(i 0;i<4;i++) for(j-i+1;j<5;j++) if(p[i] >Score>p[j] >Score) { t=p[i];p[i]=p[j];p[j]-t;} printf("%d %dkn",s[1].Score,p[1]->Score); } 执行后输出结果是
A.550 550
B.680 680
C.580 550
D.580 680
点击查看答案
第10题
有以下程序段,输出结果为()。 #include <stdio.h> struct person {char name[20]; int count; }leader[3]={"Li",0,"Zhang",0,"Sun",0}; main() {printf("%s",leader[1].name); }
点击查看答案