正在加载图片...
C++语言程序设计 湖南科技大学 数据类到 基本数 常量与变量 #include < iostream using namespace std; int maino 据 变量先声 类明后使用 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 ⅴ=3.14159**r米h; cout<<y<end1C++语言程序设计 湖南科技大学 9 数据类型 ——常量与变量 #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; } 常量 变量 变量先声 明后使用 符号常量 基 本 数 据 类 型 和 表 达 式
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有