Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int p=0,c=0,n,x,mp,mn;
- for (x=1;x<=4;x++){
- cout << "Ingrese un numero: ";
- cin >> n;
- if (n<0) { c++;
- if (c==1) {mn=n;}
- else {
- if (n>mn) {mn=n;}
- }
- }
- else {
- p++;
- if (p==1) {mp=n;}
- else {
- if (n>mp) {mp=n;}
- }
- }
- }
- cout << "El Maximo Negativo es: " << mn << endl;
- cout << "El Minimo Positivo es: " << mp << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement