正在加载图片...
C++语言程序设计 湖南科技大学 数据类型 毫型数据 基本数据类型 include iostream> using namespace std 整型变量声明 lint main0 const int price=30 整型变量 int num, total short float v r, h unsigned short num=10 整型常量」 total=num米 PRICE 表 2字节 int cout<<total <<endl 达| unsigned int r=2.5 式 4字节h=3.2; long ⅴ=3.14159**米h unsigned long couty < endl 4字节C++语言程序设计 湖南科技大学 10 #include <iostream> using namespace std; int main() { const int PRICE=30; int num,total; float v ,r,h; num=10; total=num*PRICE; cout<<total <<endl; r=2.5; h=3.2; v=3.14159*r*r*h; cout<<v <<endl; } 数据类型 ——整型数据 整型常量 short unsigned short 2字节 int unsigned int 4字节 long unsigned long 4字节 整型变量 整型变量声明 基 本 数 据 类 型 和 表 达 式
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有