1 条题解
-
0
C++ :
#include<iostream> #include<cstdio> #include<cstring> using namespace std; void swap(char *p,char *q) { char str[50]; strcpy(str,p); strcpy(p,q); strcpy(q,str); } int main() { char s1[50],s2[50],s3[50]; char *p1=s1,*p2=s2,*p3=s3; gets(p1); gets(p2); gets(p3); if (strcmp(p1,p2)>0) swap(p1,p2); if (strcmp(p1,p3)>0) swap(p1,p3); if (strcmp(p2,p3)>0) swap(p2,p3); printf("%s\n%s\n%s\n",p1,p2,p3); return 0; }
- 1
信息
- ID
- 34
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者