Begedeu Posted December 1, 2014 Report Posted December 1, 2014 (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;inceputp<-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 .Multumescintreg a,b,p,i; inceput p<-0; citeste a,b; pentru i=1 , b executap<-p+a;scrie p;sfarsit.PS. Exemplu:a=3 si b=4, p=3+3+3+3=12. Edited December 1, 2014 by Usr6 2 x post Quote
Byte-ul Posted December 1, 2014 Report Posted December 1, 2014 Poti sa imparti la 1/b ...p=a/(1/b) Quote
Begedeu Posted December 1, 2014 Author Report Posted December 1, 2014 (edited) Multumesc de ajutor .edited . Edited December 1, 2014 by Usr6 2 x post Quote
Eustatiu Posted December 3, 2014 Report Posted December 3, 2014 #include <iostream>using namespace std;int main(){ int a,b,k=0,p=0; cin>>a; cin>>b; while(k< { p=p+a; k++; } cout<<p;} Quote