Pascal/Turbo Pascal - Fatal: Syntax error, ":" expected but "(" found

 
Vista:
sin imagen de perfil

Fatal: Syntax error, ":" expected but "(" found

Publicado por Stefano (1 intervención) el 22/04/2016 03:40:57
Buenas,
necesito ayuda con este programa


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program numeros;
 
var n, digitos:integer;
 
  writeln('ingrese N');
  readln(n);
  digitos:=0;
 
  repeat
  n div 10;
  digitos:=digitos+1;
 
  until
  n<10;
  digitos:=digitos+1;
 
  writeln('La cantidad de digitos es ', n);
  readln;
end.

Y el error que me tira es :
project1.lpr(5,10) Fatal: Syntax error, ":" expected but "(" found
Supuestamente despues de un writeln va un ( y no un :
que se supone que haga??
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Fatal: Syntax error, ":" expected but "(" found

Publicado por ramon (2158 intervenciones) el 22/04/2016 12:00:58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{Compara tus dos programas y veras el fallo }
 
program numeros;
var n, digitos:integer;
 begin
  writeln('ingrese N');
  readln(n);
  digitos:=0;
  repeat
     n := n div 10;
     digitos := digitos + 1;
  until n < 10;
  digitos := digitos + 1;
  writeln('La cantidad de digitos es ', digitos);
  readln;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Fatal: Syntax error, ":" expected but "(" found

Publicado por tomas (2 intervenciones) el 22/08/2020 23:35:55
yo tengo el mismo problema que el señor pero en un until.
adjunto el codigo, pero aun no lo termino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Program Gasolinera;
 
USES
	crt;
 
VAR
 
	{tipo de combustoble}
	Tipo: string;
	{cantidades}
	CantComun, CantGasoil, CantSuper, CantKero: integer;
	{total por combustible}
	Comun, Gasoil, Super, Kero: integer;
	{porcentaje por combustible}
	PorcenComun, PorcenGasoil, PorcenSuper, PorcenKero: real;
	{total}
	TotalLitros: integer;
	{menu}
	opcion: integer;
	{volver al menu}
	volver: integer;
 
PROCEDURE combustible;
 
	begin
		WriteLn('opcion elegida: ', opcion);
		WriteLn;
		Repeat
			WriteLn('tenemos 4 tipos de combustible: ');
			WriteLn;
			WriteLn('1- Comun');
			WriteLn('2- Super');
			WriteLn('3- GasOil');
			WriteLn('4- Kerosene');
			ReadLn(Tipo);
 
			if UPCASE(Tipo) = 'COMUN' then
				begin
					WriteLn('opcion elegida: ', Tipo);
					WriteLn;
					WriteLn('ingrese la cantidad de combustible que desea');
					ReadLn(CantComun);
					Comun:= Comun + CantComun;
				end
			else
				if UPCASE(Tipo) = 'SUPER' then
					begin
						WriteLn('opcion elegida: ', Tipo);
						WriteLn;
						WriteLn('ingrese la cantidad de combustible que desea');
						ReadLn(CantSuper);
						Super:= Super + CantSuper;
					end
				else
					if UPCASE(Tipo) = 'GASOIL' then
						begin
							WriteLn('opcion elegida: ', Tipo);
							WriteLn;
							WriteLn('ingrese la cantidad de combustible que desea');
							ReadLn(CantGasoil);
							Gasoil:= Gasoil + CantGasoil;
						end
					else
						if UPCASE(Tipo) = 'KEROSENE' then
							begin
								WriteLn('opcion elegida: ', Tipo);
								WriteLn;
								WriteLn('ingrese la cantidad de combustible que desea');
								ReadLn(CantKero);
								Kero:= Kero + CantKero;
							end
						else
							begin
								WriteLn;
								WriteLn('opcion inncorrecta');
								WriteLn;
							end;
 
		WriteLn('ingrese (1) si quiere seguir cargando combustible ');
		WriteLn('ingrese (2) si quiere volver al menu ');
		ReadLn(volver);
		UNTIL(volver = 2);
 
	end;
 
begin
	TextBackground(0);
	TextColor(10);
	Clrscr;
 
	Repeat
		begin
			WriteLn('--sea bienvenido a la gasolinera--');
			WriteLn;
			WriteLn('elija la opcion a la que desea acceder');
			WriteLn;
			WriteLn('1- Cargar Combustible');
	  		WriteLn('2- Mostrat total de venta por combustible');
	 		WriteLn('3- Mostrar porcentaje de venta por combustible');
	 		WriteLn('4- Mostrar el total vendido');
	  		WriteLn('0- Salir');
	  		ReadLn(opcion);
	  		case opcion of
 
	  		1:
	  			begin
	  				combustible;
	  				ReadLn;
	  				Clrscr;
	  			end;
			0:
			begin
        		WriteLn;
        		WriteLn('saliendo...');
        		WriteLn;
        		readln();
      	  	end;
 
    UNTIL(opcion=0);
end.

el error es: gasolinera.pas(119,10) Fatal: Syntax error, ":" expected but "(" found
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar