sonprao

004

Oct 23rd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment