修改文件结构。

This commit is contained in:
unlockable
2023-02-21 10:56:54 +08:00
parent a64cfdd9f3
commit 40182871f4
83 changed files with 0 additions and 0 deletions

25
POP/10/Exercise03.c Normal file
View File

@@ -0,0 +1,25 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main() {
char inputString[100] = {0};
int length = 0, i = 0;
bool moved = true;
char temp;
scanf("%s", inputString);
length = strlen(inputString);
while (moved) {
moved = false;
for (int i = 0; i < length-1; i++) {
if (inputString[i] < inputString[i+1]) {
temp = inputString[i];
inputString[i] = inputString[i+1];
inputString[i+1] = temp;
moved = true;
}
}
}
printf("%s\n", inputString);
return 0;
}