Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Q2;
- var
- resultado:array[1..6] of integer;
- aposta:array[1..10] of integer;
- i,j,pontos:integer;
- cont:char;
- Begin
- repeat
- pontos:=0;
- for i:=1 to 6 do
- begin
- writeln('Informe os números da mega-sena: ');
- readln(resultado[i]);
- end;
- for i:=1 to 10 do
- begin
- writeln('Informe sua aposta: ');
- readln(aposta[i]);
- end;
- for j:=1 to 6 do
- begin
- for i:=1 to 10 do
- begin
- if resultado[j] = aposta[i] then
- inc(pontos);
- end;
- end;
- textcolor(yellow);
- case pontos of
- 6: writeln('Você acertou a mega-sena!');
- 5: writeln('Você acertou a quina!');
- 4: writeln('Você acertou a quadra!');
- else writeln('Tente novamente!');
- end;
- textcolor(10);
- writeln('Deseja continuar? [S/N]!');
- readln(cont);
- until upcase(cont) = 'N';
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement