Enter a string in reverse order and output the string in reverse order.
Input Format:
Enter a non-empty string that cannot exceed 80 characters and ends with a carriage return.
Output Format:
Output the reverse string in a row.
Input example:
Hello world!
Output example:
! Dlrow olleh
# Include<Stdio. h>Int main (){Char s [81] = { 0 }; // char C; int I = 0; do {scanf ( " % C ", & S [I ++]); /* If (C! = '\ N') {s [I ++] = C ;} */} while (s [I- 1]! = '\ n'); I = I- 2; // press enter to take up two characters while (I >=< SPAN class = "integer"> 0) {printf ( " % C ", s [I --]); // I --;} printf ( " \ n "); return 0 ;}
-
- # Include <stdio. h>
-
- # Include <string. h>
-
- Int main ()
-
- {
-
- Char str1 [81], str2 [82];
-
- Gets (str1 );
-
- For (Int I = strlen (str1)-1; I> = 0; I --)
-
- {
- Str2 [strlen (str1)-1-I] = str1 [I]; // The character array is saved separately.
-
- }
-
- Str2 [strlen (str1)] ='\ 0 ';
-
- Puts (str2 );
-
- Return 0;
-
- }