下列语句应将小写字母转换为大写字母,其中正确的是()。
第1题:
此题为判断题(对,错)。
第2题:
已知char ch=′C′;则以下表达式的值是
ch=(ch>=′A′ && ch<=′Z′)?(ch+32):ch;
A.A
B.a
C.Z
D.c
第3题:
有下列程序 program test(input,output); var s:integer; ch:char; count:array[‘a‘..‘z‘]of integer; begin for ch:=‘a‘to‘z‘do count[ch]:=0; read(ch); while not eoln do begin if(ch>=‘a‘)and(chx[5])and(x[c]/c0) or not(x[a+b]>(a+b))的值是( )。
Atrue
Bfalse
C0
D1
第4题:
A.
B. a
C. Z
D. z
第5题:
3下列程序中,若从键盘中输入的是大写字母C,则程序输出的结果是( )。import java.io.*;public class Exam{public static void main(String args[]){ int ch=0; System.out.println("输入一个字符:"); try{ ch=System.in.readO; char ch_A='A', ch_ Z='Z'; int delta_c=(int)ch_A +(int)ch_Z-ch; System.out.println("编码后的字符为: "+(char)delta_c); } catch(IOException e){ e.printStackTrace(); } }}
A.C
B.Y
C.X
D.字母C的ASCII码的整型值
第6题:
下列程序运行时 , 若输入 labcedf2df< 回车 > 输出结果为【 1 0 】
#include <stdio.h>
main()
{ char a=0,ch;
while((ch=getch ar ())!='\n')
{ if(a%2!=0&&(ch>='a'&&ch<='z')) ch=ch-'a'+'A';
a++; putchar(ch);
}
printf("\n");
}
第7题:
判断字符型变量ch是否为大写英文字母,应使用表达式
A.ch>='A' & ch<='Z'
B.ch<='A'||ch>='Z'
C.'A'<=ch<='Z'
D.ch>='A' && ch<='Z'
第8题:
下列程序运行时,若输入labced12df<回车> 输出结果为【10】
#include <stdio.h>
main( )
{char a =0,ch;
while((ch=getchar())!=’\n’)
{if(a&2!=0&&(ch>’a’&&ch<=’z’)) ch=ch-‘a’+’A’;
a++;putchar(ch);
}
printf(“\n”);
}
(10)1AbCeDf2dF
第9题:
在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。#include <stdio.h>main (){ char ch; while ((ch=getchar())!="\n") { if (ch>='A'&& ch<='B')ch=ch+32; else if (ch>='a'&& ch<='z')ch=ch-32; printf("%c",ch); } printf("\n");}
A.ABCdef
B.abcDEF
C.abc
D.DEF
第10题:
判断字符型变量ch是否为大写英文字母,应使用表达式______ .
A.ch>='A'& ch<='Z'
B.ch:='A'||ch>='Z'
C.'A'<=ch<='Z'
D.ch>='A'&& ch<='Z'