Tema: Ayuda
Ver Mensaje Individual
  #1  
Antiguo 18-04-2011
luisito2011 luisito2011 is offline
Miembro
NULL
 
Registrado: mar 2011
Posts: 82
Reputación: 16
luisito2011 Va por buen camino
Ayuda

hola.. soy yo .. otravej ando molestandolos ... ahora es con este ejercicio
LEER CUATRO NUMEROS Y DETERMINAR SI UNO DE LOS NUMEROS ES CERO SI UNO DE LOS NUMEROS ES CERO IMPRIMA CERO CASO CONTRARIO IMPRIMA NO//
bueno ami me sale.. pero con los 4 numero me salen [color=red]4 veces no o 4 veces 0
como hago para que solo me salga una vez cero si hay 0 en los 4 numeros oh no si no hay un 0 en los 4 numeros

Código Delphi [-]
var
n1,n2,n3,n4:cnumeronatural;
x:integer;
begin
  n1:=cnumeronatural.crear;
  n2:=cnumeronatural.crear;
  n3:=cnumeronatural.crear;
  n4:=cnumeronatural.crear;
  Writeln('Digite  N1');
  readln(x);
  N1.AsignarValor(x);
  Writeln('Digite  N2');
  readln(x);
  N2.AsignarValor(X);
  Writeln('Digite  N3');
  readln(x);
  N3.AsignarValor(X);
  Writeln('Digite  N4');
  readln(x);
  N4.AsignarValor(X);
  if n1.ObtenerValor>0 then begin writeln('no') end else writeln('Cero');
  if n2.ObtenerValor>0 then begin writeln('no') end else writeln('Cero');
  if n3.ObtenerValor>0 then begin writeln('no') end else writeln('Cero');
  if n4.ObtenerValor>0 then begin writeln('no') end else writeln('Cero');
  readln;
gracias

Última edición por luisito2011 fecha: 18-04-2011 a las 01:02:48.
Responder Con Cita