Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include "Konto.h"
- #include <vector>
- #include <string>
- #include "Transakcja.h"
- using namespace std;
- int main()
- {
- fstream plik1;
- fstream plik2;
- vector<Konto> konta;
- plik1.open("zad14_2.txt", ios::in);
- plik2.open("transakcje.txt", ios::in);
- if (plik1.is_open()&&plik2.is_open())
- {
- cout << "pliki otwarte poprwanie" << endl;
- }
- std::string numerKonta;
- std::string wlasciciel;
- string stanKonta;
- while (!plik1.eof())
- {
- getline(plik1, numerKonta, ';');
- getline(plik1, wlasciciel, ';');
- getline(plik1, stanKonta, '\n');
- float istanKonta = stof(stanKonta);
- Konto nowe = { numerKonta, wlasciciel, istanKonta };
- konta.push_back(nowe);
- }
- string numerObciazonego;
- string numerUznanego;
- string kwota;
- vector<Transakcja> transakcje;
- while (!plik2.eof())
- {
- getline(plik2, numerObciazonego, ';');
- getline(plik2, numerUznanego, ';');
- getline(plik2, kwota);
- float fkwota = stof(kwota);
- Transakcja nowa = { numerObciazonego, numerUznanego, fkwota};
- transakcje.push_back(nowa);
- }
- przelew(konta, transakcje);
- for (auto itr = konta.begin(); itr != konta.end(); itr++)
- {
- cout << itr->numerKonta << " ";
- cout << itr->wlasciciel << " ";
- cout << itr->stanKonta << endl;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement