Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- using namespace std;
- int main(){
- int n1,n2,n3,n4;
- int m,n,a = 0,b = 0 ;
- int d1,d2;
- cout<<"Ingrese n1: ";
- cin>>n1;
- cout<<"Ingrese n2: ";
- cin>>n2;
- cout<<"Ingrese n3: ";
- cin>>n3;
- cout<<"Ingrese n4: ";
- cin>>n4;
- m=n1;
- if (n2>m){m=n2;}
- if (n3>m){m=n3;}
- if (n4>m){m=n4;}
- cout << " mayor"<< m;
- n=n1;
- if (n2<n){n=n2;}
- if (n3<n){n=n3;}
- if (n4<n){n=n4;}
- cout << " menor"<< n;
- if( n1 != m && n1 != n )
- {
- d1 = n1;
- }
- if( n2 != m && n2 != n )
- {
- d1 = n2;
- }
- if( n3 != m && n3 != n )
- {
- d1 = n3;
- }
- if( n4 != m && n4 != n )
- {
- d1 = n4;
- }
- //d2
- if( n1 != m && n1 != n && n1 != d1 )
- {
- d2 = n1;
- }
- if( n2 != m && n2 != n && n2 != d1 )
- {
- d2 = n2;
- }
- if( n3 != m && n3 != n && n3 != d1 )
- {
- d2 = n3;
- }
- if( n4 != m && n4 != n && n4 != d1 )
- {
- d2 = n4;
- }
- a=m+n;
- if((a)%2==0){
- b = d1*d2;
- cout<<"El resultado es: "<<(b);
- }else{
- b = d1+d2;
- cout<<"El resultado es: "<<(b);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement