Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <ctype.h>
- #include <string.h>
- #pragma warning(disable:4996)
- char buffer[100][1020] = {0};
- void reverse(char *str){
- int n = strlen(str);
- char tmp = 0;
- int lb = 0,ub = n - 1;
- while(lb < ub){
- tmp = str[lb];str[lb] = str[ub];str[ub] = tmp;
- lb++;ub--;
- }
- }
- int main(int argc,char **argv){
- FILE *fp2 = fopen("out2.txt","w");
- int cur = 0;
- while(gets(buffer[cur])){
- reverse(buffer[cur]);
- cur++;
- }
- while(cur--){
- puts(buffer[cur]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement