Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long int a[5], c=500000,sum=0,k=-5,d=0;
- for(int i=0;i<5;i++){
- scanf("%d",&a[i]);
- sum+=a[i];
- for(int m=0;m<5;m++){
- d=sum-a[m];
- if(c>d){
- c=d;
- d=0;
- }
- if(d>k){
- k=d;
- d=0;
- }
- }
- }
- printf("%d\n%d\n",c,k);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement