题目内容

int mylength(char *p){ int len=0; while(*p!='\0') { len++; ________ ; } return(len);}main(){ char str1[80]; scanf("%s",str1); printf("str1 的长度=%d",mylength(str1));}

查看答案
更多问题

以下程序输出结果是( )#include#includeint main(){char *p="Good",str[30]="Very";strcat(str,p);str[4]='g';printf("%s\n",str+2);return 0;}

以下程序的输出 结果是_______________struct info { int b; int p;}; void f(struct info c) { c.b=3; c.p=4;}int main(){ struct info a={1,2}; f(a); printf("%d%d\n",a.b,a.p);}

以下程序输出结果是___________#includestruct Person{int no;char sex;};void func1(struct Person per2){per2.no=6001;per2.sex='M';}void func2(struct Person *ptr){ptr->no=6002;ptr->sex='M';}int main(){struct Person per1={5001,'F'};func1(per1);printf("%d,%c\n",per1.no,per1.sex);func2(&per1);printf("%d,%c\n",per1.no,per1.sex);return 0;}

定义一个结构类型,要求输入一个学生的数学和计算机两门课的成绩,然后计算并输出其平均成绩。请填空。int main(){struct student{int math,computer;}stu;printf("请输入分数: ");scanf("%d%d",&stu.math,&stu.computer);printf("平均分是:%f ",(__填空__)/2.0);}

答案查题题库