Skip to content

Instantly share code, notes, and snippets.

@godtaehee
Created January 17, 2019 01:50
Show Gist options
  • Save godtaehee/14196cccfe649b5e3536289f3aa45a65 to your computer and use it in GitHub Desktop.
Save godtaehee/14196cccfe649b5e3536289f3aa45a65 to your computer and use it in GitHub Desktop.
C++
#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