Ir ao conteúdo
  • Cadastre-se

Luan_Fox

Membro Júnior
  • Posts

    2
  • Cadastrado em

  • Última visita

posts postados por Luan_Fox

  1. (você precisa declarar a varialvel  aux:=0;)

    program p6 ;
    uses crt;
    procedure auxiliar (var bissexto:boolean; ano:integer);
    begin
        if (ano mod 400=0) then
               bissexto:=true;
        if (ano mod 4=0) and (ano mod 100 <> 0) then
               bissexto:=true
         else
            bissexto:=false;
    end;
        var
            mes,aux,anoX:integer;
            biss:boolean;
        begin
    
                    writeln('Entre com o ano: ');
            readln(anoX);
            auxiliar (biss,anoX);
            writeln('Entre com o mes: ');
            readln(mes);
            if (mes) > 12 then
            writeln ('Mes invalido');
            if (mes) <= 12 then
            begin
                if (biss=false) and (mes = 2) then
                aux:=28;
            end
            else
                    aux:=0;
            begin
                if (mes = 01) then
                            aux:= 31
                else if (mes = 02) then
                            aux:= 29
                else if (mes = 03) then
                            aux:= 31
                else if (mes = 04) then
                            aux:= 30
                else if (mes = 05) then
                            aux:= 31
                else if (mes = 06) then
                            aux:= 30
                else if (mes = 07) then
                            aux:= 31
                else if (mes = 08) then
                            aux:= 31
                else if (mes = 09) then
                            aux:= 30
                else if (mes = 10) then
                            aux:= 31
                else if (mes = 11) then
                            aux:= 30
                else if (mes = 12) then
                            aux:= 31;
            end;
            writeln('O mes ',mes,' do ano de ',anoX,' possui ',aux,' dias. ');
                    readkey;
        end.

     

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

 

GRÁTIS: ebook Redes Wi-Fi – 2ª Edição

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!