#include <iostream>
using namespace std;
int main() {
cout << "int:" << sizeof(int) << endl;
cout << "double:" << sizeof(double) << endl;
cout << "float:" << sizeof(float) << endl;
cout << "short int:" << sizeof(short int) << endl;
}
写一个程序,输出在你使用的C++系统中int类型的数据占几个字节,double类型的 数据占几个字节,short int占几个字节,float类型占几个字节。
阅读 171
2022-02-28
#include <iostream>
using namespace std;
int main() {
cout << "int:" << sizeof(int) << endl;
cout << "double:" << sizeof(double) << endl;
cout << "float:" << sizeof(float) << endl;
cout << "short int:" << sizeof(short int) << endl;
}
相关推荐
精彩评论(0)