A: 求最大数
B: 求最小数
C: 找到数组最后一个元素
D: 编译出错
举一反三
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是()temp=score[0];for(intindex=1;index<5;index++){if(score[index]temp=score[index];}} A: 求最大数 B: 求最小数 C: 找到数组最后一个元素 D: 编译出错
- core是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是____?temp = score[0];for (int index = 1;index < 5;index++) {if (score[index] > temp) {temp = score[index];}}Systyem.out.println(temp); A: 求最大数 B: 求最小数 C: 找到数组最后一个元素 D: 编译出错
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是() temp = score[0]; for (int index = 1;index < 5;index++) { if (score[index] < temp) { temp = score[index]; } }
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是
- 当输入为 ‘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
内容
- 0
若有定义int score[10];,则对score数组中的元素的正确引用是( ) A: score[10] B: score[6.0] C: score[0] D: score(7)
- 1
对于如下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
- 2
下面代码的运行结果是( )。 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
- 3
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.
- 4
#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]