Advertisement
Guest User

An Le

a guest
Apr 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3.  
  4. using namespace std;
  5. typedef struct data {
  6.     float x;
  7.     float y;
  8. }datasample;
  9.  
  10. int main() {
  11.     int N, i;
  12.     datasample dulieu[20000];
  13.     N = 2;
  14.     ifstream myReadFile;
  15.     myReadFile.open("assignment1.input.txt");
  16.     char output[100];
  17.     i = 0;
  18.     if (myReadFile.is_open()) {
  19.         while (!myReadFile.eof()) {
  20.  
  21.             myReadFile >> dulieu[i].x >> dulieu[i].y;
  22.             cout << dulieu[i].x << " " << dulieu[i].y << endl;
  23.             i++;
  24.         }
  25.     }
  26.     myReadFile.close();
  27.     system("pause");
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement