Advertisement
kk258966

C++期末參考三

Jun 11th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int main(void)
  5. {
  6.     int i;
  7.     FILE *read;
  8.     read = fopen("input.txt","r");
  9.     int line[10];
  10.    
  11.     while(!feof(read))
  12.     {
  13.                       fscanf(read,"%d %d %d %d %d %d\r\n",&line[1],&line[2],&line[3],&line[4],&line[5],&line[6]);
  14.                       for (i=1;i<=6;i++)
  15.                       {
  16.                           printf("%d ",line[i]);
  17.                       }
  18.                       printf("\n================================\n\n");
  19.     }
  20.    
  21.     fclose(read);
  22.    
  23.     system("pause");
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement