[ Foro de Pascal ]
Hola
Tengo un programa de Dev pasal que quisiera pulirlo en sus resultados
Al ejecutarlo se repiten muchos datos y quisiera saber si hay alguna manera de evitarlos.
Este es el programa
De antemano agradezco vuestra ayuda
program combinar;
uses crt,windows;
var x,x1,x2,x3,x4,x5,x6,x7,u:integer;
logic1,logic2,logic3,logic4,logic5,logic6,logic7:text;
result:text;
a:array[1..5550000] of integer;
b:array[1..5550000] of integer;
c:array[1..5550000] of integer;
d:array[1..5550000] of integer;
e:array[1..5550000] of integer;
f:array[1..5550000] of integer;
g:array[1..5550000] of integer;
begin
assign(result,'C:\Dev-Pas\combi.txt');
rewrite(result);
assign(logic7,'C:\Dev-Pas\grupo_7.txt');
reset(logic7);
assign(logic6,'C:\Dev-Pas\grupo_6.txt');
reset(logic6);
assign(logic5,'C:\Dev-Pas\grupo_5.txt');
reset(logic5);
assign(logic4,'C:\Dev-Pas\grupo_4.txt');
reset(logic4);
assign(logic3,'C:\Dev-Pas\grupo_3.txt');
reset(logic3);
assign(logic2,'C:\Dev-Pas\grupo_2.txt');
reset(logic2);
assign(logic1,'C:\Dev-Pas\grupo_1.txt');
reset(logic1);
for x:=1 to 6 do
begin
readln(logic1,u);
a[x]:=u;
end;close(logic1);
for x:=1 to 5 do
begin
readln(logic2,u);
b[x]:=u;
end;close(logic2);
for x:=1 to 5 do
begin
readln(logic3,u);
c[x]:=u;
end;close(logic3);
for x:=1 to 3 do
begin
readln(logic4,u);
d[x]:=u;
end;close(logic4);
for x:=1 to 4 do
begin
readln(logic5,u);
e[x]:=u;
end;close(logic5);
for x:=1 to 2 do
begin
readln(logic6,u);
f[x]:=u;
end;close(logic6);
for x:=1 to 4 do
begin
readln(logic7,u);
g[x]:=u;
end;close(logic7);
for x1:=1 to 6 do
begin
for x2:=1 to 5 do
begin
for x3:=1 to 5 do
begin
for x4:=1 to 3 do
begin
for x5:=1 to 4 do
begin
for x6:=1 to 2 do
begin
for x7:=1 to 4 do
begin
writeln(result,a[x1],' ',b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',f[x6]);
writeln(result,a[x1],' ',b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',g[x7]);
writeln(result,b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',f[x6],' ',g[x7]);
Este es el resultado
36 33 8 23 47 24****
36 33 8 23 47 9//////
33 8 23 47 24 9
36 33 8 23 47 24*****
36 33 8 23 47 14
33 8 23 47 24 14
36 33 8 23 47 24*****
36 33 8 23 47 18
33 8 23 47 24 18
36 33 8 23 47 24*****
36 33 8 23 47 45
33 8 23 47 24 45
36 33 8 23 47 29
36 33 8 23 47 9///////
33 8 23 47 29 9
36 33 8 23 47 29
36 33 8 23 47 14
33 8 23 47 29 14
36 33 8 23 47 29
36 33 8 23 47 18
33 8 23 47 29 18
36 33 8 23 47 29
36 33 8 23 47 45
33 8 23 47 29 45
36 33 8 23 5 24
36 33 8 23 5 9
Como evitar que se repitan?
writeln(result,a[x1],' ',b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',f[x6]);
writeln(result,a[x1],' ',b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',g[x7]);
writeln(result,b[x2],' ',c[x3],' ',d[x4],' ',e[x5],' ',f[x6],' ',g[x7]);
Me comí esto último
end;end;end;end;end;end;end;
close(result);
end.
(No se puede continuar esta discusión porque tiene más de dos meses de antigüedad. Si tienes dudas parecidas, abre un nuevo hilo.)