单项选择题

以下程序运行后的输出结果是 #include<stdio.h> main() { int a[5]={1, 2, 3, 4, 5}, b[5]={0, 2, 1, 3, 0}, i, s=0; for(i=0; i<5; i++) s=s+a[b[i]]; printf("%d\n", s); }

A.6
B.10
C.11
D.15
<上一题 目录 下一题>
热门 试题

单项选择题
有以下定义和语句: struct workers { int num; char name[20]; char c; struct {int day; int month; int year; } s; }; struct workers w, *pw; pw=&w; 能给w中year成员赋值1980的语句是
A.*pw.year=1980;
B.w.year=1980;
C.pw->year=1980;
D.w.s.year=1980;
单项选择题
下列关于return语句的叙述中,正确的是
A.一个自定义函数中必须有一条return语句
B.一个自定义函数中可以根据不同情况设置多条return语句
C.定义成void类型的函数中可以有带返回值的return语句
D.没有return语句的自定义函数在执行结束时不能返回到调用处
相关试题
  • 以下程序的功能是:删除字符串中所有的空格...
  • 以下程序运行后的输出结果是______。...
  • 以下程序的功能是:将值为3位正整数的变量...
  • 以下程序的功能是:借助指针变量找出数组元...
  • 以下程序运行后输入“abcdef”,则输出结果...