Created
January 17, 2019 01:50
-
-
Save godtaehee/14196cccfe649b5e3536289f3aa45a65 to your computer and use it in GitHub Desktop.
C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
cin.tie(NULL); | |
ios_base::sync_with_stdio(false); | |
int a[3]; | |
int tmp; | |
for(int i = 0; i < 3; i++) | |
cin >> a[i]; | |
for(int i = 0; i < 2; i++){ | |
for(int j = 0; j < 2; j++){ | |
if(a[j] >= a[j+1]){ | |
tmp = a[j]; | |
a[j] = a[j+1]; | |
a[j+1] = tmp; | |
} | |
} | |
} | |
cout << a[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment