C++变量的基础使用

📅 发布时间:2026/7/12 10:15:34 👁️ 浏览次数:
C++变量的基础使用
int整型的变量float实型的变量声明char字符型变量声明string字符串型变量声明#include iostream using namespace std; int main() { system (chcp 65001); int age; //整型的变量 float height; //实型的变量声明 char gender; //字符型变量声明 string name; //字符串型变量声明 //变量的赋值变量名 变量值 age 28; height 186; gender M; name Zayne; cout name is my Lover.He is age years old, height centimeters tall, he is a gender endl; return 0; }