从键盘上输入: abcde 使得c1=’a’,c2=’d’并输出c1、c2所对应的大写字母
时间: 2023-11-11 17:03:36 浏览: 80
```
#include <iostream>
using namespace std;
int main() {
char c1, c2;
cin >> c1 >> c2;
if (c1 == 'a') {
cout << "C1对应的大写字母是A" << endl;
} else if (c1 == 'b') {
cout << "C1对应的大写字母是B" << endl;
} else if (c1 == 'c') {
cout << "C1对应的大写字母是C" << endl;
} else if (c1 == 'd') {
cout << "C1对应的大写字母是D" << endl;
} else if (c1 == 'e') {
cout << "C1对应的大写字母是E" << endl;
}
if (c2 == 'a') {
cout << "C2对应的大写字母是A" << endl;
} else if (c2 == 'b') {
cout << "C2对应的大写字母是B" << endl;
} else if (c2 == 'c') {
cout << "C2对应的大写字母是C" << endl;
} else if (c2 == 'd') {
cout << "C2对应的大写字母是D" << endl;
} else if (c2 == 'e') {
cout << "C2对应的大写字母是E" << endl;
}
return 0;
}
```
输入:`abcde`
输出:
```
C1对应的大写字母是A
C2对应的大写字母是D
```
阅读全文