Created
December 29, 2009 20:25
-
-
Save zuigon/265569 to your computer and use it in GitHub Desktop.
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> | |
#include <math.h> | |
using namespace std; | |
int n[3]; | |
char x[6][6]; | |
int br[6]; | |
int max_br(){ | |
int max=0; | |
for(int i=0; i<6; i++) | |
if(br[i]>max) max=br[i]; | |
return max; | |
} | |
int main(int argc, char** argv){ | |
cin >> n[0]>>n[1]>>n[2]; | |
sprintf(x[0], "%d%d%d", n[0],n[1],n[2]); | |
sprintf(x[1], "%d%d%d", n[0],n[2],n[1]); | |
sprintf(x[2], "%d%d%d", n[1],n[0],n[2]); | |
sprintf(x[3], "%d%d%d", n[1],n[2],n[0]); | |
sprintf(x[4], "%d%d%d", n[2],n[0],n[1]); | |
sprintf(x[5], "%d%d%d", n[2],n[1],n[0]); | |
for(int i=0; i < 6; i++) | |
sscanf(x[i], "%d", &br[i]); | |
// for(int i=0; i<6; i++){ | |
// cout <<"! "<<x[i]<<endl; | |
// } | |
// cout << "Brojevi: "<<endl; | |
// for(int i=0; i<6; i++) | |
// cout << "! "<<br[i]<<endl; | |
cout <<max_br()<<endl; //MAX | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment