Advertisement
kk258966

C++期末參考四

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