📄 l32.1a
字号:
#printWrite a program pair(a,b)which accepts as arguments two pointers to integersand swaps the integers if necessary so that thefirst argument points to the larger one; that is int x,y; x = 9; y = 15; pair( &x, &y);results in x being 15 and y 9. Leave the programon file "pair.c"; compile, test it, and type "ready".#once #create tzaqc.cmain(){ int x,y; y=200; x = 0; pair(&y, &x); if (x != 0 || y != 200) return(1); pair(&x,&y); if (x != 200 || y != 0) return(1); x = 30; y = 23097; pair(&x,&y); if (x != 23097 || y != 30) return(1); return(0);}#usercc tzaqc.c pair.oa.out #succeedpair(a, b)int *a, *b;{ int t; if (*a <= *b) { t = *a; *a = *b; *b = t; }}#log#next33.1a 10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -