Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <vector>
- #include <fstream>
- using namespace std;
- int main()
- {
- unsigned short int num1;
- float num2, num3;
- vector<unsigned short int>index;
- vector<float>lenght;
- vector<float>coordinate;
- ifstream InFile1;
- ifstream InFile2;
- ifstream InFile3;
- InFile1.open("E:\Programming Languages\HelloC++\Geodetic\Index.txt");
- InFile2.open("E:\Programming Languages\HelloC++\Geodetic\Lenght.txt");
- InFile3.open("E:\Programming Languages\HelloC++\Geodetic\Coordinate.txt");
- if (!InFile1 || !InFile2 || !InFile3){
- cerr << "Sorry Couldn't Open The Filen.";
- }
- while (InFile1 >> num1) {
- index.push_back(num1);
- }
- while (InFile2 >> num2) {
- lenght.push_back(num2);
- }
- while (InFile3 >> num3){
- coordinate.push_back(num3);
- }
- for (size_t i = 0; i < coordinate.size(); i++) {
- cout << coordinate[i]<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment