Skip to content

Commit b947fdf

Browse files
pair.cpp
1 parent 8364c3a commit b947fdf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pair.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <iostream>
2+
#include <utility> // std::pair, std::make_pair
3+
#include <string> // std::string
4+
#include <vector>
5+
6+
int main() {
7+
std::vector<std::pair<std::string, int> > scores;
8+
scores.push_back(std::make_pair("Emily", 99));
9+
scores.push_back(std::make_pair("Nick", 80));
10+
scores.push_back(std::make_pair("Steven", 75));
11+
12+
for(std::pair<std::string, int> p : scores){
13+
std::cout << p.first << " " << p.second << std::endl;
14+
}
15+
16+
return 0;
17+
}

0 commit comments

Comments
 (0)