16_leer 20 números e imprimir la tercera parte de todos los positivos
C:
#include
Main ()
{
Int C=1;
Float F, G, I;
While (C<=20)
{
Printf (“ingrese un numero: “);
Scanf (“%F”,&G);
If (G>0);
{
I=G/3;
Printf (“la tercera parte del numero es:%F”,I);
}
C++;
}
}
Python:
#!/usr/bin/python
C=1
While (C<=20):
Num1=float(raw_input(“ingrese un numero: “))
If (num1>0):
I=num1/3
Print (“la tercera parte del numero es:”) + str (I)
C=C+1
No hay comentarios:
Publicar un comentario