#include<iostream>
#include<cmath>
using namespace std;
int main()
{
cout << "Size of char : " << sizeof(char) << endl;
cout << "Size of int : " << sizeof(int) << endl;
cout << "Size of short int : " << sizeof(short int) << endl;
cout << "Size of long int : " << sizeof(long int) << endl;
cout << "Size of float : " << sizeof(float) << endl;
cout << "Size of double : " << sizeof(double) << endl;
cout << "Size of long long " << sizeof(long long) << endl;
cout << "Size of wchar_t : " << sizeof(wchar_t) << endl;
string name,address;
int age;
cout << "your name:"<< endl;
getline(cin,name);
cout << "your address:" << endl;
getline(cin,address);
cout << "your ages:" << endl;
cin >> age;
cout << "I am " << name << " and I live in " << address << endl;
cout << "I am " << age << " years old\n";
cout << "Next year I am " << age+1 << endl;
return 0;
}
C++的数据类型和输入输出
最新推荐文章于 2024-03-15 18:29:54 发布