C++ 习题六.docVIP

  • 1
  • 0
  • 约1.98万字
  • 约 32页
  • 2016-11-24 发布于河南
  • 举报
C习题六

C++ 习题六 习题六 Xt6-1 #include iostream using namespace std; int main() {void swap(int *p1,int *p2); int n1,n2,n3; int *p1,*p2,*p3; coutinput three integers n1,n2,n3:; cinn1n2n3; p1=n1; p2=n2; p3=n3; if(n1n2) swap(p1,p2); if(n1n3) swap(p1,p3); if(n2n3) swap(p2,p3); coutNow,the order is:n1 n2 n3endl; return 0; } void swap(int *p1,int *p2) {int p; p=*p1; *p1=*p2; *p2=p; } Xt6-2-1 #include iostream #include cstring using namespace std; int main() {void swap(char *,char *); char str1[20],str2[20],str3[20]; coutinput three line:endl; gets(str1); gets(str

文档评论(0)

1亿VIP精品文档

相关文档