Problema 1
INICIO
x,y int
f real
print "x y f(x,y)"
for (x=2 to 8 step
x=x+2)
{
for (y=6 to 21 step
y=y+3)
{
f=(pow(x,2)-pow(y,2))/(pow(x,2)+pow(y,2))
print x," ",y," ",f
}
}
FIN
problema 2
INICIO
x,y,f float
print"x y"
for (x=-4 to4 step x=x+1)
{
for (y=-5 to5 step y=y+1)
{
f=(pow(x,2)/16)+(pow(y,2)/25);
if (f==1)
{
print,x," ",y
}
}
}
FIN
problema 3
INICIO
int n=0,i=1,j=0;
do
{
cout,"introduce valor posiivo"
cin,n
if (n<0)
{
cout"el numero no es valido"
}
}
while (n<0)
for (i=1 to i<=n stepi=i+1)
{
for (j=1 to j<=(n-(i-1)) stepj=j+1)
{
cout,j
}
}
FIN
Problema 4
1.-Inicio
n=0, i=0, edad=0, goles=0, asistencia=0,min=0,
jugador=0 int
nombre [15] char
altura, peso, f real
eva=0, mayor=0 real
Print “Introduzca numero: ”
read n
for(i=1 to n step
i=i+1)
{
Print “Nombre: ”
Read nombre
Print “Edad: ”
Read edad
Print "altura en pulgadas: "
Read altura
Print “Peso: ”
Read peso
Print “Goles: ”
Read goles
Print “Asistencia: ”
Read asistencia
Print “Minutos: ”
Read min
Print “Factor de liga: ”
Read f
eva=
((goles+asistencia-min)/4+(altura+peso)/5-edad)*f
Print "Nombre: ",nombre
Print "Evaluacion: ",eva
if (eva>mayor)
{
mayor=eva
jugador=i
}
}
Print "Jugador con evalucion mayor:
",jugador
Print “Evaluacion: ",mayor
Fin.
No hay comentarios:
Publicar un comentario