Zdroják: Kombinace proměnných.cpp
Vzhled
- include <vector>
- include <iostream>
- include <fstream>
- include<string>
- include<cstdio>
using namespace std; int main(int argc, char *argv[]) {
if (argc != 3) { cerr << "Nutno volat s parametrem 2 souborů !" << endl; return -1; } typedef std::vector<std::string> intdeq; intdeq var; string s; ifstream in2(argv[2]); while(getline(in2, s) ){var.push_back(s);} intdeq::iterator ib = var.begin(); intdeq::iterator ie = var.end(); intdeq::iterator it=ib; ifstream in(argv[1]); while(getline(in, s) ){ for (it=ib;it!=ie;++it) std::cout<<"["<<s<<","<<*it<<"] \n"; } return 0;
}