A: 求最大数
B: 求最小数
C: 找到数组最后一个元素
D: 编译出错
举一反三
- temp = score[0]; for (int index = 1;index < 5;index++) { if (score[index] < temp) {temp = score[index]; }} score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读上面代码,程序运行结果是【 】 A: 求最大数 B: 求最小数 C: 找到数组最后一个元素 D: 编译出错
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是()temp=score[0];for(intindex=1;index<5;index++){if(score[index]temp=score[index];}} A: 求最大数 B: 求最小数 C: 找到数组最后一个元素 D: 编译出错
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是() temp = score[0]; for (int index = 1;index < 5;index++) { if (score[index] < temp) { temp = score[index]; } }
- 对于如下C程序:#include [stdio.h] void Func (char *); int main() { char str[20]; scanf ("%s", str); Func(str); printf ("%s\n", str);} void Func(char *str) { int i = 0; int index = 0; char temp; while (str[index] != '\0'){ index++; } for (i = 0; i < index/2 ; i++){ temp = str[i]; str[i] = str[index - 1 - i]; str[index - 1 - i] = temp; }}如果输入为“abcd”,则输出为:[/i][/i] A: abcd B: dcba C: dcdc D: abab
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是
内容
- 0
当输入为 ‘cbabc’ 时,下列程序的输出结果为?s1 = raw_input() index = 0 s2 = '' while index [ len(s1) - 1: if s1[index] ] s1[index + 1]: s2 += s1[index] else: s2 = s2 * 2 index += 1 print s2
- 1
下面代码的运行结果是( )。 var arr=[1,2,3,4,5,6]; var index=arr.indexOf(3,6); console.log(index); A: 2 B: -1 C: 5 D: 0
- 2
int index = 1; int [] foo = new int [3]; int bar = foo [index]; int baz = bar + index; What is the result?() A: Baz has the value of 0 B: Baz has the value of 1 C: Baz has the value of 2 D: An exception is thrown. E: The code will not compile.
- 3
#include<stdio.h> main() {int i,index,n: int a[10]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); index=0; for(i=1;i<n;i++) {if(a[i]<a[index])index=i;} printf("min=%d,index=%d\n",a[index],index); } 程序运行时输入5 7 9 5<回车>,则程序运行结果是:______[/i][/i]
- 4
下面程序段的运行结果为() int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz= bar+index;