⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typ_cas2.cpp

📁 数据结构常用算法合集
💻 CPP
字号:
 //typ_cas2.cpp
 #include <iostream.h>	//cout
 #include <conio.h>	//getch()
 void main()
 { short int a=6, c;
   float x=500.123, y=3.2;
   c = a * (int) x;				//将浮点数先转换为整数再计算=整数
   cout << "c=" << c << endl;
   c = (int) x * int (y);			//浮点数先转换为整数再计算=整数
  cout << "c=" << c << endl;
  x = 6634.45; y = 5.44;
  c = (int) x * short (y);		//数据运算后大于32767
  cout << "c=" << c << endl;
  getch();
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -