Skip to content

Commit

Permalink
r_time
Browse files Browse the repository at this point in the history
  • Loading branch information
hus-king committed Dec 5, 2024
1 parent 3da0b1a commit e8d50e1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Binary file modified output/r.exe
Binary file not shown.
31 changes: 31 additions & 0 deletions r.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <stdio.h>
#include <string.h>
void make(char *past,char *now,int i,int j){
strcpy(now,past);
while(i<j){
char temp;
temp=now[j];
now[j]=now[i];
now[i]=temp;
i++;
j--;
}
}
int main(){
char past[200];
scanf("%s",past);
int n;
n=strlen(past);
char min[200];
strcpy(min,past);
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
char now[200];
make(past,now,i,j);
if(strcmp(now,min)<0){
strcpy(min,now);
}
}
}
puts(min);
}

0 comments on commit e8d50e1

Please sign in to comment.