判断字符型变量s是否为大写字母的正确形式为( )。
A: 'A'<=s<='Z'
B: (s>='A')||(s<='Z')
C: (s>='A')&&(s<='Z')
D: (s>='A')&(s<='Z')
A: 'A'<=s<='Z'
B: (s>='A')||(s<='Z')
C: (s>='A')&&(s<='Z')
D: (s>='A')&(s<='Z')
举一反三
- 在压力为p时,饱和水的熵为s′;干饱和蒸汽的熵为s″。当湿蒸汽的干度0<x<1时,其熵为s,则( ) A: s>s″>s′ B: s<s′<s″ C: s′>s>s″ D: s″>s>s′
- 以下程序的功能只保留字符串的小写字母,请将程序补充完整。#include void fun(char s[]) { int i,j; for(i=0,j=0;s[i]!='\0';i++) if ( (1) ) { s[j]=s[i]; (2) ; } s[j]='\0'; } void main() { char s[100]="abc123abc123abc"; (3) ; puts(s); }(1)应该填写的是:[/i][/i] A: s[i]>='a'&&s[i]<='z' B: s[i]>='A'&&s[i]<='Z C: s[i]>='0'&&s[i]<='9' D: s[i]>=a&&s[i]<=z
- 判断char型变量ch是否为大写字母的正确表达式是( ) A: 'A' <= ch <= 'Z' B: (ch >= 'A') & (ch <= 'Z') C: (ch >= 'A') && (ch <= 'Z') D: (ch >= 'A') || (ch <= 'Z')
- 下面判断ch是大写或者小写英文字母的表达式哪个正确? A: ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z' B: ch >= A && ch <= Z || ch >= a && ch <= z C: 'A' <= ch <= 'Z' || 'a' <= ch <= 'z' D: A <= ch <= Z || a <= ch <= z
- 下列选项中用于判断ch是否是英文字母的表达式是( )。? ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' )|;( 'a' <= ch <= 'z' ) || ( 'A' <= ch <= 'Z' )|( ch >= 'a' && ch <= 'z' ) && ( ch >= 'A' && ch <= 'Z' )|( 'a' <= ch <= 'z' ) && ( 'A' <= ch <= 'Z' )