下载此文档

《c程序设计》谭浩强课后习题答案.doc


文档分类:IT计算机 | 页数:约127页 举报非法文档有奖
1/127
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/127 下载此文档
文档列表 文档介绍
第一章 题#inc lude <iost ream> usin g nam espac e std ; int main (){ cout <<"Th is"<< "is"; cou t<<"a "<<"C ++"; cout <<"pr ogram ."; retur n0; ---- ----- ----- ----- ----- ---- 题#incl ude < iostr eam> using name space std; int main( ){ inta ,b,c; a=1 0;b =23; c=a+ b;c out<< "a+b= ";c out<< c;c out<< endl; ret urn 0;} ----- ----- ----- ----- ----- ----- 七题#i nclud e <io strea m> us ing n amesp ace s td; int ma in() { int a,b ,c; intf (int x,int y,in t z); cin >>a>> b>>c; c=f (a,b, c); cout< <c<<e ndl; retu rn0;} int f(intx, inty ,int z) { int m; if (x< y) m= x; else m=y; if (z<m) m=z; r eturn (m); } --- ----- ----- ----- ----- ----- ----- ----- 题#in clude <ios tream > usi ngna mespa ce std; int mai n() { int a,b, c;c in>>a >>b; c=a+ b;c out<< "a+b= "<<a+ b<<en dl; retur n0;} -- ----- ----- ----- ----- ----- ----- ----- --- 题#inc lude <iost ream> usin g nam espac e std ; int main (){ int a,b,c ; int add (int x,int y); cin> >a>>b ; c= add(a ,b); cout <<"a+ b="<< c<<en dl; retur n0;} int add (int x,int y) { intz; z= x+y; retu rn(z) ;}= ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== = 题#in clude <ios tream > usi ngna mespa ce std; int mai n() {char c1=' a',c2 ='b', c3='c ',c4= '\101 ',c5= '\116 '; cout< <c1<< c2<<c 3<<'\ n'; cout <<"\t \b"<< c4<<' \t'<< c5<<' \n'; ret urn 0;} ----- ----- ----- ----- ----- ---- 题#inc lude <iost ream> usin g nam espac e std ; int main (){ char c1='C ',c2= '+',c 3='+' ;c out<< "I sa y: \" "<<c1 <<c2< <c3<< '\"'; co ut<<" \t\t" <<"He says : \"C ++ is very inte resti ng!\" "<< ' \n'; ret urn 0;} ----- ----- ----- ----- ----- ----- ----- -#i nclud e <io strea m> us ing n amesp ace s td; int ma in() {int i,j, m,n; i=8; j=1 0;m =++i+ j++; n=(+ +i)+( ++j)+ m; c out<< i<<'\ t'<<j <<'\t '<<m< <'\t' <<n<< endl; ret urn 0;}# inclu de <i ostre am> u sing names pace std; intm ain() {cha r c1= 'C', c2='h ', c3 ='i', c4=' n',c 5='a' ; c1 +=4; c2+= 4;c 3+=4; c4+

《c程序设计》谭浩强课后习题答案 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数127
  • 收藏数0 收藏
  • 顶次数0
  • 上传人slv2qq6
  • 文件大小658 KB
  • 时间2017-05-25