1、用c++编写一个程序使用type函数查看变量name、age、height三个变量存储的数据类型。条件:name=测试 age = 20 height = 175运行结果:class strclass intclass float
#include
int main(){ string name = "测试"; int age = 20; float height = 1.75;
cout << typeid(name).name() << endl;
cout << typeid(age).name() << endl;
cout << typeid(height).name() << endl;
return 0;
}
原文地址: https://cveoy.top/t/topic/je8i 著作权归作者所有。请勿转载和采集!