0311
This commit is contained in:
parent
7d9d3d66eb
commit
747dcefe75
23
0311/1.c
Normal file
23
0311/1.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void swap(char *a, char *b) {
|
||||
char temp = *a;
|
||||
*a = *b;
|
||||
*b = temp;
|
||||
}
|
||||
|
||||
int main() {
|
||||
char num[3];
|
||||
scanf("%s", num);
|
||||
|
||||
if (num[2] > num[1]) {
|
||||
swap(num + 2, num + 1);
|
||||
}
|
||||
if (num[1] > num[0]) {
|
||||
swap(num + 1, num);
|
||||
}
|
||||
if (num[2] > num[1]) {
|
||||
swap(num + 2, num + 1);
|
||||
}
|
||||
printf("%s\n", num);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user