sonprao Oct 23rd, 2018 31 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     int s1,s2,s3,a[100],i,j,k,max,x;
  5.     for (i=1;i<=101;i++) a[i]=0;
  6.     cin>>s1>>s2>>s3;
  7.     for (i=1;i<=s1;i++)
  8.         for (j=1;j<=s2;j++)
  9.         for (k=1;k<=s3;k++) a[i+j+k]++;
  10.         max=a[1];
  11.     for (i=2;i<=100;i++)
  12.      {if (a[i]>max) max=a[i];}
  13.     for (i=2;i<=90;i++) if (a[i]==max) {x=i; break;}
  14.      cout<<x;
  15.     return  0;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand