fork download
  1. uses crt;
  2. var
  3. so1,so2,tong:string;
  4. i,tam,nho,ht1,ht2:integer;
  5. begin
  6. clrscr;
  7. nho:=0;
  8. write('nhap so thu nhat:');readln(so1);
  9. write('nhap so thu hai:');readln(so2);
  10. while length(so1) > length(so2) do
  11. so2:='0'+so2;
  12. while length(so2) > length(so1) do
  13. so1:='0'+so1;
  14. for i:=length(so1) downto 1 do
  15. begin
  16. val(so1[i],ht1);val(so2,ht2);
  17. tam:=(ht1+ht2+nho) mod 10;
  18. nho:=(ht1+ht2) div 10;
  19. str(tam,tong[i]);
  20. end;
  21. writeln(so1,' + ',so2,' = ',tong);
  22. readln;
  23. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling prog.pas
prog.pas(19,25) Error: Illegal expression
prog.pas(21,41) Warning: Variable "tong" does not seem to be initialized
prog.pas(23,4) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
stdout
Standard output is empty