ex3_11.cpp
来自「Beginning Visual C++ 6源码。Wrox。」· C++ 代码 · 共 22 行
CPP
22 行
// EX3_11.CPP
// Display ASCII codes for alphabetic characters
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
for(char capital='A', small='a'; capital<='Z'; capital++, small++)
cout << endl
<< "\t" << capital // Output capital as character
<< hex << setw(10) << static_cast<int>(capital) // Output capital as hex
<< dec << setw(10) << static_cast<int>(capital) // Output capital as decimal
<< " " << small // Output small as character
<< hex << setw(10) << static_cast<int>(small) // Output small as hex
<< dec << setw(10) << static_cast<int>(small); // Output small as decimal
cout << endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?