Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. int main(int argc, char *argv[])
  2. {
  3. FILE* fp = fopen("test.txt","rw");
  4. int n,m,q;
  5. scanf(" %d%d%d",&n,&m,&q);
  6. struct test_t test;
  7. while (fscanf(fp,"%d%s%d%d%d%d%d%d%d%*d",&test.line,test.data,&test.number[0],&test.number[1],&test.number[2],&test.number[3],&test.number[4],&test.number[5],&test.number[6])!=EOF) {
  8. //do something.....
  9. }
  10. return 0;
  11. }
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15. int n,m,q;
  16. scanf(" %d%d%d",&n,&m,&q);
  17. struct test_t test;
  18. FILE* fp = fopen("test.txt","rw");
  19. while (fscanf(fp,"%d%s%d%d%d%d%d%d%d%*d",&test.line,test.data,&test.number[0],&test.number[1],&test.number[2],&test.number[3],&test.number[4],&test.number[5],&test.number[6])!=EOF) {
  20. //do something....
  21. }
  22. return 0;
  23. }
  24.  
  25. 141 2015-12-05 19 16 35 06 34 46 09 00
  26. 124 2015-12-08 49 25 10 09 40 48 32 00
  27. 143 2015-12-10 09 29 24 47 32 34 42 00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement