English
English
Slovensky
Slovensky
Česky
Česky
Šarišsky
Šarišsky
 
Kategória: Zadania Pascal

Autor: Pheo
web: pascalsource.ic.cz

Program: Prevod.pas
Súbor exe: Prevod.exe
Program určí ciferný súčet daného čísla.
Zobrazené: 1084x


{ PREVOD.PAS                                     Copyright (c) Pheo }
{ Program určí ciferný súčet daného čísla.                          }
{                                                                   }
{ Datum:15.04.2003                             http://www.trsek.com }
 
program prevod;
uses crt;
var X:string;
    s,i,d:Integer;
begin
  Writeln('Zadaj cislo X ako retazec: ');
  Readln (X);
  s:=0;
  D:=length(X);
  for i:=1 to d do s:=s+ord(x[i])-48;
  writeln('Ciferny sucet je ', s);
  readln;
end.
 
 

[Spustiť] [Uložiť] [Tlač] [Poslať e-mailom]