Skip to content

Instantly share code, notes, and snippets.

@Adals20
Created February 2, 2017 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adals20/e30d87feb3da31017f54e729cba6975d to your computer and use it in GitHub Desktop.
Save Adals20/e30d87feb3da31017f54e729cba6975d to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int minimunThree(int x, int y, int z){
if (y>=x && z>=x)
return (x);
else if(y<=x && y<=z)
return (y);
else if (z<=x && z<=y)
return (z);
}
int sumSquares(int x, int y, int z){
int x2 = x*x;
int y2 = y*y;
int z2 = z*z;
int s = x2+y2+z2;
return (s);
}
int main(){
int x,y,z,a,b;
cout << "Introdusca el primer numero: ";
cin >> x;
cout << "Introdusca el segundo numero: ";
cin >> y;
cout << "Introdusca el tercer numero: ";
cin >> z;
a = minimunThree(x,y,z);
cout << "El numero menor es: " << a << endl;
b = sumSquares(x,y,z);
cout << "La suma de los cuadrados es: " << b << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment