欢迎来到天天文库
浏览记录
ID:53783370
大小:528.50 KB
页数:105页
时间:2020-04-06
《C++程序设计内容编程实例大全.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、C++程序编程实例大全#includeintmain(){std::cout<<"helloworld!";}#include"iostream"usingnamespacestd;voidmain(){int*p;p=newint;*p=5;/*p=newint(5);*/cout<<*p;deletep;}#include"iostream"usingnamespacestd;voidmain(){charname[10];cout<<"pleaseinputyourname:";cin>>name;cout<<"thenameis"<2、e<>name;cout<<"howoldareyou:";cin>>age;cout<<"thenameis"<3、n;cin>>n;studentwang;wang.no=n;cin>>wang.math;cout<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<4、[i]=i*2;cout<<"Nowoutputthearray:"<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<5、n;i++)p[i]=i*i+1;cout<<"Nowoutputthearray:"<usingnamespacestd;floata=2.4;voidmain(){inta=8;cout<voidmain(){intnum=6、50;int&ref=num;ref+=10;cout<<"num="<voidmain(){intnum;int&ref=num;num=5;cout<<"num="<7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
2、e<>name;cout<<"howoldareyou:";cin>>age;cout<<"thenameis"<3、n;cin>>n;studentwang;wang.no=n;cin>>wang.math;cout<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<4、[i]=i*2;cout<<"Nowoutputthearray:"<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<5、n;i++)p[i]=i*i+1;cout<<"Nowoutputthearray:"<usingnamespacestd;floata=2.4;voidmain(){inta=8;cout<voidmain(){intnum=6、50;int&ref=num;ref+=10;cout<<"num="<voidmain(){intnum;int&ref=num;num=5;cout<<"num="<7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
3、n;cin>>n;studentwang;wang.no=n;cin>>wang.math;cout<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<4、[i]=i*2;cout<<"Nowoutputthearray:"<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<5、n;i++)p[i]=i*i+1;cout<<"Nowoutputthearray:"<usingnamespacestd;floata=2.4;voidmain(){inta=8;cout<voidmain(){intnum=6、50;int&ref=num;ref+=10;cout<<"num="<voidmain(){intnum;int&ref=num;num=5;cout<<"num="<7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
4、[i]=i*2;cout<<"Nowoutputthearray:"<>n;if((p=newint[n])==0){cout<<"can'tallocatemorememory,terminating"<5、n;i++)p[i]=i*i+1;cout<<"Nowoutputthearray:"<usingnamespacestd;floata=2.4;voidmain(){inta=8;cout<voidmain(){intnum=6、50;int&ref=num;ref+=10;cout<<"num="<voidmain(){intnum;int&ref=num;num=5;cout<<"num="<7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
5、n;i++)p[i]=i*i+1;cout<<"Nowoutputthearray:"<usingnamespacestd;floata=2.4;voidmain(){inta=8;cout<voidmain(){intnum=
6、50;int&ref=num;ref+=10;cout<<"num="<voidmain(){intnum;int&ref=num;num=5;cout<<"num="<7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
7、<"&ref="<<&ref<usingnamespacestd;voidswap(int&x,int&y);voidmain(){intx=5,y=6;cout<<"beforeswap,x:"<//u
此文档下载收益归作者所有