Guest User

Untitled

a guest
Oct 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. struct marshrut {
  6. char marsh1[60], marsh2[60],num[3];};
  7. void main () {
  8. const int n=8;
  9. char x[500];
  10. int i=0;
  11. marshrut ma[n];
  12. FILE *f=fopen("input.txt","r");
  13. while (fgets(x,500,f)!=0){
  14. sscanf (x, "%s %s %s",ma[i].marsh1,ma[i].marsh2,ma[i].num);
  15. i++;
  16. }
  17. for (i=0;i<n;i++)
  18. cout << ma[i].marsh1 << " " << ma[i].marsh2<< " " << ma[i].num <<"\n";
  19.  
  20. }
Add Comment
Please, Sign In to add comment