⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex3_11.cpp

📁 Visual C++ 2005的源代码
💻 CPP
字号:
// Ex3_11.cpp
// Display ASCII codes for alphabetic characters
#include <iostream>
#include <iomanip>

using std::cout;
using std::endl;
using std::hex;
using std::dec;
using std::setw;

int main()
{
   for(char capital = 'A', small = 'a'; capital <= 'Z'; capital++, small++)
      cout << endl
           << "\t" << capital                      // Output capital as a character
           << hex << setw(10) << static_cast<int>(capital)   // and as hexadecimal
           << dec << setw(10) << static_cast<int>(capital)   // and as decimal
           << "    " << small                      // Output small as a character
           << hex << setw(10) << static_cast<int>(small)     // and as hexadecimal
           << dec << setw(10) << static_cast<int>(small);    // and as decimal

   cout << endl;
   return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -