阅读程序,它在一行里给每个字符各查一遍大写、小写:
string s = "NoIp2026";
int up = 0, low = 0;
for (char ch : s) {
if (isupper(ch)) up++;
if (islower(ch)) low++;
}
cout << up << " " << low;
程序输出是( )
- A. 2 2
- B. 2 6
- C. 1 3
- D. 4 4
g5-07260.in输出g5-07260.out阅读程序,它在一行里给每个字符各查一遍大写、小写:
string s = "NoIp2026";
int up = 0, low = 0;
for (char ch : s) {
if (isupper(ch)) up++;
if (islower(ch)) low++;
}
cout << up << " " << low;
程序输出是( )