You are on page 1of 2

#include <fstream.

h>
#include <stdio.h>
#include <conio.h>
void main ()
{float a,b,c,d,e,min,max;
cout<<"Ingrese los 5 numeros\n";
cin>>a>>b>>c>>d>>e;
min=a;
max=a;
{if(min>b)
min=b;
if(min>c)
min=c;
if(min>d)
min=d;
if(min>e)
min=e;}

if(max<b)
max=b;
if(max<c)
max=c;
if(max<d)
max=d;
if(max<e)
max=e;

cout<<"el menor es "<<min<<" y el mayor es "<<max<<"\n";


getch();
}

#include <fstream.h>
#include <conio.h>

void main()
{char nom[30];
int na, op;
float p1, p2, p3, p4, p5, pp, pf, ppc, min, nota, nsusti;
cout<<"Cuantos alumnos hay?\n";
cin>>na;
while(na>0)
{cout<<"\nnombre:\n";
cin>>nom;
cout<<"Notas de las practicas:\n";
cin>>p1>>p2>>p3>>p4>>p5;
cout<<"Examen parcial:\n";
cin>>pp;
cout<<"Examen final:\n";
cin>>pf;
min=p1;
if(min>p2)
min=p2;
if(min>p3)
min=p3;
if(min>p4)
min=p4;
if(min>p5)
min=p5;
ppc=(p1+p2+p3+p4+p5-min)/4;
if(ppc<6.1)
{
cout<<"no da susti , va a veranito con arevalo\n";
nota=(ppc+pp+pf)/3;
cout<<"\nnota final es: "<<nota<<" ";
}
else
{
cout<<"iras al susti :v (SI=0 || NO=1) \n";
cin>>op;
switch(op)
{
case 0:
{
cout<<"nota susti\n";
cin>>nsusti;
if(pp<=pf)
{
nota=(ppc+pf+nsusti)/3;
cout<<"\nnota final es: "<<nota<<" ";
}
else
{
nota=(ppc+pp+nsusti)/3;
cout<<"\nnota final es: "<<nota<<" ";
}
}
break;
case 1:
{nota=(ppc+pp+pf)/3;
cout<<"\nnota final es: "<<nota<<" ";
}
break;
}

na--;
}
}
getch();
}