SHOW:
|
|
- or go back to the newest paste.
| 1 | - | var cislo, mocnina,i,vysledok: integer; |
| 1 | + | var |
| 2 | vstup, novy:string; | |
| 3 | - | cislo:= strtoint (edit1.Text); |
| 3 | + | i:integer; |
| 4 | - | mocnina:= strtoint (edit2.Text); |
| 4 | + | |
| 5 | - | vysledok:=1; |
| 5 | + | vstup:= (edit1.Text); |
| 6 | - | if (cislo=0) and (mocnina=0) then showmessage ('ne')
|
| 6 | + | novy:=''; |
| 7 | - | else |
| 7 | + | for i:= 1 to length(vstup) do |
| 8 | - | for i:= 1 to mocnina do |
| 8 | + | |
| 9 | if (vstup[i]>='0') and (vstup[i]<='9') or | |
| 10 | - | vysledok:= vysledok * cislo; |
| 10 | + | vstup[i]>='a') and (vstup[i]<='z') or |
| 11 | vstup[i]>='A') and (vstup[i]<='Z') then | |
| 12 | novy:= novy + vstup[i]; | |
| 13 | - | label1.Caption:= inttostr (vysledok); |
| 13 | + | |
| 14 | memo1.lines.add (novy); | |
| 15 | end; | |
| 16 | ||
| 17 | end. |