⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rostr8.pas

📁 This ar the basic programs that i did in highschool. From very simple to medium programs. From array
💻 PAS
字号:
var s:string;
    n,i,p,c:integer;
    cod:boolean;
begin
write('s=');
readln(s);
n:=0;
p:=1;
cod:=false;
   for i:= length(s) downto 1 do
begin
     if (s[i]>='0') and (s[i]<='9') then
                                    begin
                                    c :=ord(s[i])-ord('0');
                                    n:=n +c*p;
                                    end
                                    else if (upcase(s[i]) >='A') and (upcase(s[i])<='Z') then
                                                                                         begin
                                                                                         c:=ord(upcase(s[i]))-ord('A')+10;
                                                                                         n:=n+c*p;
                                                                                         end
                                                                                         else cod:=true;
p:=p*16;
end;
if cod=false then write(n)
            else write ('eroare la pozitia',length(s)-i +1);
readln;
end.





















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -