• 2022-06-04
    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: 编译出错
  • A

    举一反三

    内容

    • 0

      当输入为 ‘cbabc’ 时,下列程序的输出结果为?s1 = raw_input() index = 0 s2 = '' while index &#91; len(s1) - 1: if s1&#91;index&#93; &#93; s1&#91;index + 1&#93;: s2 += s1&#91;index&#93; else: s2 = s2 * 2 index += 1 print s2

    • 1

      下面代码的运行结果是( )。 var arr=&#91;1,2,3,4,5,6&#93;; var index=arr.indexOf(3,6); console.log(index); A: 2 B: -1 C: 5 D: 0

    • 2

      int index = 1;  int &#91;&#93; foo = new int &#91;3&#93;;  int bar = foo &#91;index&#93;;  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&#91;10&#93;; 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&#91;index&#93;)index=i;} printf("min=%d,index=%d\n",a&#91;index&#93;,index); } 程序运行时输入5 7 9 5<回车>,则程序运行结果是:______[/i][/i]

    • 4

      下面程序段的运行结果为() int index=1; int&#91;&#93; foo=new int&#91;3&#93;; int bar=foo&#91;index&#93;; int baz= bar+index;