Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char s[100], arr[100];
- #define f fflush(stdin)
- int main(){
- int n;
- scanf("%d", &n);
- f;
- FILE *fp;
- fp = fopen("my.txt", "w");
- while(n--){
- f;
- scanf("%s", s);
- fprintf(fp, "%s %c", s, '\n');
- }
- fclose(fp);
- fp = fopen("my.txt", "r");
- while(fscanf(fp, "%s", arr) != EOF){
- f;
- printf("%s\n", arr);
- }
- fclose(fp);
- return 0;
- }
Add Comment
Please, Sign In to add comment