Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //napiste program ktory zisti kolko krat sa zadane cislo vyskytuje mezdi n zadanymi cislami
- program kolkocisielmam;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- var cislo:string;
- i,a,b,c,d,e,f,g,h,j:byte;
- begin
- { TODO -oUser -cConsole Main : Insert code here }
- write('Lubovolne cislo: ');
- readln(cislo);
- a:=0;
- b:=0;
- c:=0;
- d:=0;
- e:=0;
- f:=0;
- g:=0;
- h:=0;
- j:=0;
- for i:=1 to length(cislo) do
- begin
- case cislo[i] of
- '1':a:=a+1;
- '2':b:=b+1;
- '3':c:=c+1;
- '4':d:=d+1;
- '5':e:=e+1;
- '6':f:=f+1;
- '7':g:=g+1;
- '8':h:=h+1;
- '9':j:=j+1;
- end;
- end;
- writeln('1 = ',a);
- writeln('2 = ',b);
- writeln('3 = ',c);
- writeln('4 = ',d);
- writeln('5 = ',e);
- writeln('6 = ',f);
- writeln('7 = ',g);
- writeln('8 = ',h);
- writeln('9 = ',j);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment