Guest User

Untitled

a guest
Nov 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <vector>
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. unsigned short int num1;
  10. float num2, num3;
  11. vector<unsigned short int>index;
  12. vector<float>lenght;
  13. vector<float>coordinate;
  14. ifstream InFile1;
  15. ifstream InFile2;
  16. ifstream InFile3;
  17. InFile1.open("E:\Programming Languages\HelloC++\Geodetic\Index.txt");
  18. InFile2.open("E:\Programming Languages\HelloC++\Geodetic\Lenght.txt");
  19. InFile3.open("E:\Programming Languages\HelloC++\Geodetic\Coordinate.txt");
  20. if (!InFile1 || !InFile2 || !InFile3){
  21. cerr << "Sorry Couldn't Open The Filen.";
  22. }
  23. while (InFile1 >> num1) {
  24. index.push_back(num1);
  25. }
  26. while (InFile2 >> num2) {
  27. lenght.push_back(num2);
  28. }
  29. while (InFile3 >> num3){
  30. coordinate.push_back(num3);
  31. }
  32. for (size_t i = 0; i < coordinate.size(); i++) {
  33. cout << coordinate[i]<<endl;
  34. }
  35. return 0;
  36. }
Add Comment
Please, Sign In to add comment