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

📄 suma_mar.pas

📁 This ar the basic programs that i did in highschool. From very simple to medium programs. From array
💻 PAS
字号:
program suma_mare;
{Se dau doua nr. cu mai mult de 70 de cifre.Se sa afiseze suma.}
const n=10;
type cifra=0..9;
var a,b,c:array[1..n] of cifra;
    x,y,p,i:byte;
begin
write('cate cifre are a?');
readln(x);
write('cate cifre are b?');
readln(y);
for i:=1 to x do
            begin
            write('a[',i,']= ');
            readln(a[i]);
            end;
for i:=1 to y do
            begin
            write('b[',i,']= ');
            readln(b[i]);
            end;
if x>y then
   begin
        for i:=x downto x-y+1 do b[i]:=b[i-x+y];
        for i:=1 to x-y do b[i]:=0;
   end
   else
   begin
        for i:=y downto y-x+1 do a[i]:=a[i-y+x];
        for i:=1 to y-x do a[i]:=0;
   end;
if x>y then p:=x
   else p:=y;
for i:=p downto 1 do c[i]:=a[i]+b[i];
for i:=p downto 1 do
            if c[i]>10 then
                        begin
                              c[i]:=c[i] mod 10;
                              c[i-1]:=c[i-1]+1;
                        end;
{else
       begin
            for i:=y downto 1 do c[i]:=a[i]+b[i];
            for i:=y downto 1 do
                              if c[i]>10 then
                                         begin
                                              c[i]:=c[i] mod 10;
                                              c[i-1]:=c[i-1]+1;
                                         end;
       end;}

for i:=1 to p do
    write(c[i]);
    readln;
end.

⌨️ 快捷键说明

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