(1) Please enter any character from the keyboard.
(2) Please let the computer output two lines: the first line is in the form of characters, 3 characters are output, the 3 characters are separated by commas, and the second line is the ASCII code corresponding to the output characters.
#include <iostream>
using namespace std;
int main() {
char c; cin >> c;
cout << c << " - " << (int) c << endl;
return 0;
Comments
Leave a comment