//测试八、十和十六进制输入
cout<<"DEC:a="; cin>>a;
cout<<"OCT:b="; cin>>b;
cout<<"HEX:a="; cin>>c;
cout<<"DEC:"<cout<<"b="<
cout<<"c="<}
cin>>dx;
cout<<"dy=";
cin>>dy;
cout<cout<cout<cout<//cout<//测试float和double类型数据的有效位
fx=10.0;fy=6.0;
float fz=fx/fy;
dx=10.0;dy=6.0;
double dz=dx/dy;
cout<<"fz=";
cout<cout<<"dz=";
cout<//float型溢出
float x=3.5e14;
cout<<"x="<cout<<"x*x="<cout<<"x*x*x="<}
#include
main()
{
//x,y 为操作数,c为运算符
int x,y,z;
char c1;
cin>>x>>c1>>y; //c1
//多路选择语句选择不同表达式计算语句
switch(c1) {
case '+':cout<break;
case '-':cout<break;
case '*':cout<break;
case '/':cout<break;
case '%':cout<break;
default :cout<<"Wrong !"<}
}
#include
float x=365.5; //声明全局变量
main() {
int x=1,y=2;
double w=x+y;
{
double x=1.414,y=1.732,z=3.14;
cout<<"inner:x="<cout<<"inner:y="<cout<<"inner:z="<cout<<"outer:w="<cout<<"::x="<<::x<cout<<"outer:x="<cout<<"outer:y="<cout<<"outer:w="<//cout<<"inner:z="<cout<<"::x="<<::x<}
#include
main() {
//显示1,2,3 (10)
for(int i=1;i<=10;i++)