提交时间:2026-06-21 11:45:12

运行 ID: 91999

#include <bits/stdc++.h> using namespace std; // 用define定义八进制常量77 #define oct1 077 // 用const定义十六进制整型常量FF const int hex1 = 0xFF; // 用const定义字符串常量 const char str1[] = "Welcome"; // 用const定义字符双引号 const char dq1 = '"'; // 用define定义换行符 #define nl1 '\n' // 用define定义字符串 #define str2 "Great!" // 用const定义pi const double pi = 3.14159; int main() { cout << oct1 << endl; cout << hex1 << endl; cout << str1 << endl; cout << dq1 << endl; cout << nl1 << endl; cout << str2 << endl; cout << pi * 100 << endl; return 0; }