>n;"> >n;" />
欢迎来到天天文库
浏览记录
ID:47287612
大小:264.00 KB
页数:67页
时间:2020-01-09
《c++编程实例100例1》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、.输入一个整数将各位征税反转后输出#includeusingnamespacestd;intmain(){intn,right_digit,newnum=0;cout<<"Enterthenumber:";cin>>n;cout<<"thenumberinreverssrderis:";do{right_digit=n%10;cout<usingnamespacestd;intmain(){inti=1,sum
2、=0;while(i<=10){sum+=i;i++;}cout<<"sunm="<usingnamespacestd;intmain(){inti=1,sum=0;do{sum+=i;i++;}while(i<=10);..cout<<"sum="<usingnamespacestd;intmain(){longinti;intbouns1,bouns2,bouns4,bouns6,bouns10,bouns;scanf("%
3、d",&i);//%ld表示这个数据的类型是longint长整形//&i表示i的地址,及输出的是i的值bouns1=100000*0.1;bouns2=bouns1+10000090.75;bouns4=bouns2+200000*0.5;bouns6=bouns4+200000*0.3;bouns10=bouns6+400000*0.15;if(i<=100000)bouns=i*0.1;elseif(i<=200000)bouns=bouns1+(i-100000)*0.075;elseif(i<=400000)bouns=bouns2+(i-200000)*0.05;else
4、if(i<=600000)bouns=bouns4+(i-400000)*0.03;elseif(i<=10000000)bouns=bouns6+(i-600000)*0.15;elsebouns=bouns10+(i-1000000)*0.01;printf("bouns=%d",bouns);//输出一个数据a为整形数据。}星期intday;cout<<"输入数:";cin>>day;switch(day){case0:cout<<"sunday"<5、day"<usingnamespacestd;intmain(){intx,y;cout<<"Enter6、xandy:";cin>>x>>y;if(x!=y)if(x>y)cout<<"x>y"<usingnamespacestd;intmain(){intyear;..boolisLeapYear;cout<<"Entertheyear:";cin>>year;isLeapYear=((year%4==0&&year%100!=07、8、year%400==0));if(isLeapYea9、r)cout<Intmain(){inti,j,k;printf(
5、day"<usingnamespacestd;intmain(){intx,y;cout<<"Enter
6、xandy:";cin>>x>>y;if(x!=y)if(x>y)cout<<"x>y"<usingnamespacestd;intmain(){intyear;..boolisLeapYear;cout<<"Entertheyear:";cin>>year;isLeapYear=((year%4==0&&year%100!=0
7、
8、year%400==0));if(isLeapYea
9、r)cout<Intmain(){inti,j,k;printf(
此文档下载收益归作者所有