Playground
#include <iostream> #include <vector> using namespace std; int main() { pair<int, string> p; p.first = 5; //p.first e od tip 'int' p.second = "pet"; //p.second e od tip 'string' cout << p.first << " " << p.second << endl; //pechati '5 pet' vector<pair<string, double> > v; pair<string, double> p1; p1 = make_pair("bla bla", 3.5); v.push_back(p1); v.push_back(p1); for (int i=0; i<5; i++) { pair<string, double> temp; temp = make_pair("chu chu", 0.5 * i); v.push_back(temp); } cout << v.size() << endl; //pechati '7' return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!