Dark Angel Posted June 8, 2006 at 08:04 PM Report Share #31898 Posted June 8, 2006 at 08:04 PM boas pessoal. ja fiz o programa mas nao da e precisso de ajuda se alguem puder ajudar agredecia 😉 ta ai o algoritmo k fiz e tou a programar em pascal. program euromilhoes; uses crt; var ap, i, j:integer;   n:array[1..10,1..5] of integer;   e:array[1..10,1..2] of integer; begin clrscr;      for ap:=1 to 10 do       for i:= 1 to 5 do        N[ap,i]:=random [1..50];       for j:= 1 to 2 do        E[ap,i]:= random [1..9]; end. Link to comment Share on other sites More sharing options...
Ridelight Posted June 8, 2006 at 08:11 PM Report Share #31902 Posted June 8, 2006 at 08:11 PM Antes de mais bem vindo ao Fórum para postares código utiliza a função GeShi Regras do FÓRUM Link to comment Share on other sites More sharing options...
Saco Posted June 8, 2006 at 08:17 PM Report Share #31905 Posted June 8, 2006 at 08:17 PM Primeiro bem-vindo ao fórum 😉 Segundo o post ta no sitio errado, se é pascal devia estar na secção de pascal. Terceiro se usares o GeSHi para meter código, o teu código fica assim: program euromilhoes; uses crt; var ap, i, j:integer;   n:array[1..10,1..5] of integer;   e:array[1..10,1..2] of integer; begin clrscr;      for ap:=1 to 10 do       for i:= 1 to 5 do        N[ap,i]:=random [1..50];       for j:= 1 to 2 do        E[ap,i]:= random [1..9]; end. Quarto não percebo nada de pascal, mas a linha E[ap,i]:= random [1..9]; deveria ser E[ap,j]:= random [1..9]; Quinto mesmo assim como tens 1 array para os números e outro para as letras, não precisas de arrays de dimensão dupla, portanto uma coisa deste género é capaz de funcionar... uses crt; var i, j:integer;   n:array[1..5] of integer;   e:array[1..2] of integer; begin clrscr;       for i:= 1 to 5 do        N[i]:=random [1..50];       for j:= 1 to 2 do        E[j]:= random [1..9]; end. Sexto suponho que falte mostrar os valores dos arrays E e N. Sétimo se não der pergunta outra vez, pode ser que apareça alguem que saiba 😄 Oitavo ena, ainda sei contar até 8 🙂😄 Link to comment Share on other sites More sharing options...
Dark Angel Posted June 8, 2006 at 08:32 PM Author Report Share #31906 Posted June 8, 2006 at 08:32 PM desculpem la mas k e o primeiro post que ponho!!!!!! e obrigado Link to comment Share on other sites More sharing options...
Saco Posted June 8, 2006 at 08:37 PM Report Share #31908 Posted June 8, 2006 at 08:37 PM desculpem la mas k e o primeiro post que ponho!!!!!! e obrigado Então e já funciona ou não? Isso é que interessa, agora se está no sÃtio certo ou não é secundário. Link to comment Share on other sites More sharing options...
Dark Angel Posted June 8, 2006 at 09:15 PM Author Report Share #31924 Posted June 8, 2006 at 09:15 PM Ainda nao da diz isto "Invalid qualifier" no "N[ i ]:= random [1..50]; Link to comment Share on other sites More sharing options...
Saco Posted June 8, 2006 at 09:21 PM Report Share #31926 Posted June 8, 2006 at 09:21 PM Então suponho que o Pascal seja case sensitive. Experimenta n[i]:=random [1..50]; e e[j]:= random [1..9]; Link to comment Share on other sites More sharing options...
Dark Angel Posted June 8, 2006 at 09:32 PM Author Report Share #31930 Posted June 8, 2006 at 09:32 PM tb vou ver 😉 Link to comment Share on other sites More sharing options...
Saco Posted June 8, 2006 at 09:54 PM Report Share #31948 Posted June 8, 2006 at 09:54 PM Atenção: não sei se reparaste mas fiz copy do sÃtio errado, não é n[ap,i] mas sim n, claro (já editei o post anterior). Link to comment Share on other sites More sharing options...
maiden Posted June 8, 2006 at 09:58 PM Report Share #31951 Posted June 8, 2006 at 09:58 PM Boas, antes de mais bem vindo ao fórum. 😉 A função random tem de ser iniciada para poder ser utilizada. begin   randomize;   n:=random(9) {e nao random[1..9]} end. Espero ter ajudado. Cumps, Link to comment Share on other sites More sharing options...
Dark Angel Posted June 9, 2006 at 08:07 PM Author Report Share #32159 Posted June 9, 2006 at 08:07 PM obrigadao o programa ja da bem 😉 Cumps Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now