lonsomehell

tp fichier 2

Apr 25th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main()
  5. {
  6.     FILE *f;
  7.     char ch[10];
  8.     scanf("%s",ch);
  9.     f=fopen(strcat(ch,".txt"),"r");
  10.     int i=1;
  11.     char buf[200];
  12.     while(fgets(buf,200,f)){
  13.         printf("Ligne %d\t\n",i);
  14.         printf("%s",buf);
  15.         i++;
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment