program teste;var soma_idade, idade, cont: integer;begin //soma_idade := 0; for cont := 1 to 10 do begin writeln('Digite a idade ', cont); readln(idade); soma_idade := soma_idade + idade; end; writeln('A soma das idades e ', soma_idade); readln;end.
1 2 3 4 5 6 7 8 9 10
Digite a idade 1 Digite a idade 2 Digite a idade 3 Digite a idade 4 Digite a idade 5 Digite a idade 6 Digite a idade 7 Digite a idade 8 Digite a idade 9 Digite a idade 10 A soma das idades e 55
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!