Jump to content
Begedeu

Problema in pseudocod .

Recommended Posts

Posted (edited)

Buna ziua .

Am si eu o problema in pseudocod , mai exact : Se citesc nr nat a si b.Sa se calculeze produsul lor fara a utiliza operatorul de inmultire.

Am inceput eu ceva :

intreg n,a,b,p,i;

inceput

p<-0;

citeste a,b,n;

pentru i=1 , n executa

p<-p+a;

sfarsit pentru;

sfarsit daca;

scrie p+ "Produsul lui a si b";

sfarsit .

Multumesc

intreg a,b,p,i;

inceput

p<-0;

citeste a,b;

pentru i=1 , b executa

p<-p+a;

scrie p;

sfarsit.

PS. Exemplu:a=3 si b=4, p=3+3+3+3=12.

Edited by Usr6
2 x post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...