Jump to content

Coverter Pascal em python. Alguém consegue me ajudar?


lucas souza

Recommended Posts

lucas souza

program SomaGrande; {$R+}

const NumMaxAlg=100; type indices=0..NumMaxAlg;

          digitos=0..9;

          numGrande=array[indices] of digitos;

var n, i : Integer;

          num1, num2, somaNum :numGrande;

          vaiUm:0..1;

          somaAlg:0..19;

begin

  readLn(n);

  for i:=1 to n do read(num1);

  readLn; for i:=1 to n do read(num2);

  readLn;

  vaiUm:=0;

 

for i:=n downto 1 do

  begin

        somaAlg:=num1+num2+vaiUm;

        somaNum:=somaAlg mod 10;

        vaiUm:=somaAlg div 10

 end;

    somaNum[0]:=vaiNum;

    for i:=0 to n do write(somaNum);

    writeLn

  end.

Link to post
Share on other sites

Sim podemos dar uma ajuda.

Qual é a tua dúvida ou problema concreto?

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.