• 2022-06-09
    下面的语句序列的输出结果为( ) String s="ABCD"; s.concat("E"); s.replace('C','F');
    A: ABFDE
    B: ABCDEF
    C: ABCD
    D: ABCDE
  • C

    内容

    • 0

      智慧职教: 下面程序段输出的结果是( )。 String s=”ABCD”; s.concat(“E”); s.replace(‘C’,’F’); System.out.println(s);

    • 1

      下面的哪些程序片断可能导致错误?( )。 A: String s="Gone with the wind";String t;t=s[3]+"one"; B: String s="Gone with the wind";String t="good";String k=s+t; C: String s="Gone with the wind";String standard=s.toUpperCase(); D: String s="home directory";String t=s-"directory";

    • 2

      设 char a[5],*p=a;下面选项中正确的赋值语句是( ). A: p="abcd"; B: a="abcd"; C: *p="abcd"; D: *a="abcd";

    • 3

      下面语句中,正确的是( )。 A: printf("%c ","student"); B: printf("%c ","c"); C: printf("%s ",&a); D: printf("%s ","hello");

    • 4

      以下选项能使 puts(s) 语句正确输出ABCDE字符串的程序段是__。 A: char s[5]={"ABCDE"}; puts(s); B: char s[5]={'A', 'B', 'C', 'D', 'E'}; puts(s); C: char *s; scanf("%s",s); puts(s); D: char *s; s="ABCDE"; puts(s);