Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int s1,s2,s3,a[100],i,j,k,max,x;
- for (i=1;i<=101;i++) a[i]=0;
- cin>>s1>>s2>>s3;
- for (i=1;i<=s1;i++)
- for (j=1;j<=s2;j++)
- for (k=1;k<=s3;k++) a[i+j+k]++;
- max=a[1];
- for (i=2;i<=100;i++)
- {if (a[i]>max) max=a[i];}
- for (i=2;i<=90;i++) if (a[i]==max) {x=i; break;}
- cout<<x;
- return 0;
- }
Add Comment
Please, Sign In to add comment