>a;cout<<"result"> >a;cout<<"result" />
欢迎来到天天文库
浏览记录
ID:6352693
大小:107.00 KB
页数:15页
时间:2018-01-11
《c++简明教程天津大学出版社课后习题答案》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1-7-1//输出一个数的10倍#includeusingnamespacestd;intmain(){cout<<"Pleaseinputaninterger:";inta;cin>>a;cout<<"result="<usingnamespacestd;intmain(){doublex,y,min;cout<<"pleaseinputtwonumbers"<>x>>y;min=(
2、x>y?y:x);cout<<"thesmalleris"<<''<usingnamespacestd;intmain(){cout<<"请输入半径";doublerad;cin>>rad;doublec,s;c=2*3.14*rad;s=3.14*rad*rad;cout<<"周长是"<3、iostream>usingnamespacestd;intmain(){inthour,min,second;hour=10000/3600;min=(10000%3600)/60;second=10000-hour*3600-60*min;cout<usingnamespacestd;intmain(){intnum,num_bai,nu4、m_shi,num_ge;cout<<"请输入一个三位数";cin>>num;num_bai=num/100;num_shi=(num-num_bai*100)/10;num_ge=num-num_bai*100-num_shi*10;cout<usingnamespacestd;intmain(){doubley,n;cout<<"pleaseinput5、anumber";cin>>n;if(n>0)y=n+1;if(n<0)y=n*n;if(n==0)y=0;cout<<"theresultis:"<<''<usingnamespacestd;intmain(){doublefenshu;intxuehao;chardengji;inti;for(i=1;i<=10;i++){onerror:cout<<"pleaseinputstudentscore";cin>>fenshu;if6、(fenshu>=90&&fenshu<=100)dengji='A';if(fenshu>=80&&fenshu<90)dengji='B';if(fenshu>=600&&fenshu<80)dengji='C';if(fenshu>=0&&fenshu<60)dengji='D';if(fenshu<0){cout<<"error";gotoonerror;}if(fenshu>100){cout<<"error";gotoonerror;}cout<<"theidis"<7、engji<usingnamespacestd;intmain(){charzifu;intascii;cout<<"pleaseinputacharacteristic";cin>>zifu;ascii=zifu;if(ascii>=48&&ascii<=57){cout<<"数字";gotoend;}if(ascii>=97&&ascii<=122){cout<<"小写字母";gotoend;}if(ascii>=65&&asci8、i<=90){cout<<"大写字母";gotoend;}cout<<"其他字符";cout<
3、iostream>usingnamespacestd;intmain(){inthour,min,second;hour=10000/3600;min=(10000%3600)/60;second=10000-hour*3600-60*min;cout<usingnamespacestd;intmain(){intnum,num_bai,nu
4、m_shi,num_ge;cout<<"请输入一个三位数";cin>>num;num_bai=num/100;num_shi=(num-num_bai*100)/10;num_ge=num-num_bai*100-num_shi*10;cout<usingnamespacestd;intmain(){doubley,n;cout<<"pleaseinput
5、anumber";cin>>n;if(n>0)y=n+1;if(n<0)y=n*n;if(n==0)y=0;cout<<"theresultis:"<<''<usingnamespacestd;intmain(){doublefenshu;intxuehao;chardengji;inti;for(i=1;i<=10;i++){onerror:cout<<"pleaseinputstudentscore";cin>>fenshu;if
6、(fenshu>=90&&fenshu<=100)dengji='A';if(fenshu>=80&&fenshu<90)dengji='B';if(fenshu>=600&&fenshu<80)dengji='C';if(fenshu>=0&&fenshu<60)dengji='D';if(fenshu<0){cout<<"error";gotoonerror;}if(fenshu>100){cout<<"error";gotoonerror;}cout<<"theidis"<
7、engji<usingnamespacestd;intmain(){charzifu;intascii;cout<<"pleaseinputacharacteristic";cin>>zifu;ascii=zifu;if(ascii>=48&&ascii<=57){cout<<"数字";gotoend;}if(ascii>=97&&ascii<=122){cout<<"小写字母";gotoend;}if(ascii>=65&&asci
8、i<=90){cout<<"大写字母";gotoend;}cout<<"其他字符";cout<
此文档下载收益归作者所有