Advertisement
Shickcard

Questão 2

Dec 15th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Program Q2;
  2.  
  3. var
  4. resultado:array[1..6] of integer;
  5. aposta:array[1..10] of integer;
  6. i,j,pontos:integer;
  7. cont:char;
  8.  
  9. Begin
  10.  
  11. repeat
  12. pontos:=0;
  13. for i:=1 to 6 do
  14. begin
  15. writeln('Informe os números da mega-sena: ');
  16. readln(resultado[i]);
  17. end;
  18.  
  19. for i:=1 to 10 do
  20. begin
  21. writeln('Informe sua aposta: ');
  22. readln(aposta[i]);
  23. end;
  24.  
  25. for j:=1 to 6 do
  26. begin
  27. for i:=1 to 10 do
  28. begin
  29. if resultado[j] = aposta[i] then
  30. inc(pontos);
  31. end;
  32. end;
  33.  
  34. textcolor(yellow);
  35. case pontos of
  36. 6: writeln('Você acertou a mega-sena!');
  37. 5: writeln('Você acertou a quina!');
  38. 4: writeln('Você acertou a quadra!');
  39. else writeln('Tente novamente!');
  40. end;
  41.  
  42. textcolor(10);
  43. writeln('Deseja continuar? [S/N]!');
  44. readln(cont);
  45.  
  46. until upcase(cont) = 'N';
  47.  
  48. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement