1 条题解
-
0
C :
#include<stdio.h> #include<stdlib.h> void sort(int *a,int *b) { int tmp; if(*a>*b) { tmp=*a; *a=*b; *b=tmp; } } int main() { int a,b; scanf("%d%d",&a,&b); sort(&a,&b); printf("%d %d",a,b); return 0; }
C++ :
#include<iostream> #include<cstdio> using namespace std; int swap(int x,int y) { int t; t=x; x=y; y=t; } int main() { int *point1,*point2,a,b; cin>>a>>b; point1=&a; point2=&b; if(a>b) swap(point1,point2); cout<<*point1<<" "<<*point2; return 0; }
- 1
信息
- ID
- 332
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者