Skip to content

Instantly share code, notes, and snippets.

@ows3090
Created October 9, 2020 14:42
#include<iostream>
#include<utility>
using namespace std;
int main(){
pair<int,int> p;
p.first = 3;
p.second = 4;
cout<<"p의 first : "<<p.first<<" p의 second : "<<p.second<<endl;
pair<int,int> p2 = make_pair(5,6);
cout<<"p2의 first : "<<p2.first<<" p2의 second : "<<p2.second<<endl;
p2.swap(p);
cout<<"p2의 first : "<<p2.first<<" p2의 second : "<<p2.second<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment