Department of Mathematics and Computer Sciencewww.univ-soukahras.dz/en/dept/mi |
-3 votes
|
ecrire un algorithme qui demande deux valeurs à l'utilisateur et affiche le Pgcd(a,b). example : a=12 et b= 9 donc le Pgcd(12,9)=3 |
Asked on 00:27, Friday 10 Nov 2017 By abderrahmane brinis |
answers (24)
Answer (1)
0 votes
|
Solusion : exemple: PGCD(648, 351) = ? pour calcule le PGCD de (648, 351) , on doit faire une suite de sustraction . Le plus grand - le plus petite 648-351=297 351-297=54 297-54=243 243-54=189 189-54=135 135-54=81 81-54=27 27-27=00 Donc , le PGCD est la derinier resultat de la sustraction non nule : PGCD(648,351) = 27
ALGORITHME PGCD ; Var A , B : entier ; debut repeter ecrire(' introduis deux nombre A et B ' ) ; Lire( A,B ) ; jusqua ( ( a>0) et (b>0) ) Tantque A<>B faire Si A>B alors A:=A-B Sinon B:=B-A Fsi FTQ Ecrire('PGCD= ' , A ) ;
Fin.
|
Answered on 12:32, Friday 10 Nov 2017 by Feteh HESSAINIA |
Answer (2)
0 votes
|
algorithme PGCD; var a,b:entier; debut écrire('introduisez le 1er nombre'); lire(a); écrire('introduisez le 2éme nombre'); lire(b); tantque not(a*b=0) faire si a>0 alors a:=a-b sinon b:=a-b fsi; ftq; si a=0 alors écrire('PGCD=',b) sinon écrre('PGCD=',a) fsi; fin. |
Answered on 14:10, Friday 10 Nov 2017 by rayene ridane |
Answer (3)
0 votes
|
algorithme pgcd; var a,b:entier; Début répeter écrire ('introduits deux nombres a et b'); lire (a,b); jusqua ((a>0) et (b>0)) tantque A>b faire si a>b alors a:=a-b sinon b:=b-a fsi ftq fin. |
Answered on 14:11, Friday 10 Nov 2017 by Mohamed idriss Gouasmia (31 points) |
Answer (4)
0 votes
|
merci bcb mais est-que il ya un autre solution ? |
Answered on 14:16, Friday 10 Nov 2017 by abderrahmane brinis |
Answer (5)
0 votes
|
ALGORITHME PGCD; Var x , y : entier ; debut Lire( x,y ) ; TANTQUE x<>y faire Si x>y alors x:=x-y; Sinon y:=y-x; Fsi FTQ Ecrire('PGCD= ' , x ) ;
fin.
|
Answered on 15:05, Friday 10 Nov 2017 by oussama baha eddine farhi |
Answer (6)
-1 votes
|
Oui il y'a abdelrrahman : on utilise la methode de mod |
Answered on 15:12, Friday 10 Nov 2017 by Feteh HESSAINIA |
Answer (7)
0 votes
|
oui il ya hahahaha algorithme pgcd; var a,b,c:entier; debut lire(a,b); si a<b alors c:=a; a:=b; b:=c; finsi tantque b<>0 faire c:=b; b:= a mod b a:=c ftq ecrire('pgcd est ',c); fin. |
Answered on 15:20, Friday 10 Nov 2017 by Touaitia Ouassim (12 points) |
Answer (8)
0 votes
|
hahahha mrc wassim pour cette reponse . |
Answered on 15:22, Friday 10 Nov 2017 by abderrahmane brinis |
Answer (9)
0 votes
|
algorithme pgcd; var a,b:entier; debut écrire('entrez le premier nombre'); lire(a); écrire('entrez le deuzième nombre'); lire(b); tantque (a*b<>0) faire si a>0alors a:=a-b fsi; si a<0 alors b:=b-a fsi; ftq; si a=0 alors écrire('pgcd=',b) sinon écrire('pgcd=',a) fsi; fin. |
Answered on 15:47, Friday 10 Nov 2017 by Haifa Benlassowd |
Answer (10)
-1 votes
|
y'pas deux solution wela |
Answered on 16:37, Friday 10 Nov 2017 by oussama baha eddine farhi |
Answer (11)
0 votes
|
Algorithme pgsd; Var x,y:entier ; Début écrire ('introduis les deux nombre x et y ') ; Lire (x,y); Tant que ( x*y<>0) faire Si x>0 alors X:=x-y Sinon Y:=y-x Fsi; ftq; Si x=0 alors écrire (' pgcd := y') Sinon écrire ('pgcd :=x') Fsi ; Fin . |
Answered on 23:38, Friday 10 Nov 2017 by Aitkaki kahina Aitkaki kahina (27 points) |
Answer (12)
0 votes
|
ALGORITHME PGCD ; Var a , b : entier ; debut Lire( a,b) ; Tantque A<>B faire Si a>b alors a:=a-b Sinon b:=b-a Fsi; ftq; si a>b alors ecrire('PGCD de ',a,'et',b,'= ' , a ) ; sinon ecrire('PGCD de ' ,a, 'et' ,b, '=' , b ); fsi; Fin. |
Answered on 14:26, Saturday 11 Nov 2017 by Amira Bouchehida (43 points) |
Answer (13)
0 votes
|
Algorithme PGCD; Var a,b:entier; Ecrire('introduit le premier nombre'); Lire(a); Ecrire('introduit le dexieume nombre'); Lire(b); TanQue a<>b faire Si a>b a:=a-b; Sinon B:=b-a; Fsi; FtQ; Ecrire('PGCD='a,b); Fin |
Answered on 15:49, Saturday 11 Nov 2017 by fardous bouhama |
Answer (14)
0 votes
|
Ya un solution avec pour |
Answered on 15:50, Saturday 11 Nov 2017 by fardous bouhama |
Answer (15)
0 votes
|
Program PGCD; Var a,b,x,y,z:integer; Begin Repeat Read(a,b); Until (a>0) and (b<0); If a>b then Begin X:=a; y:=b; End Else Begin X:=b; y:=a; End; While y<>0 do Begin Z:=x mod y; X:=y; Y:=z; End; Write(x); End. En pascale |
Answered on 16:30, Saturday 11 Nov 2017 by fardous bouhama |
Answer (16)
0 votes
|
algorithme pgcd; var a,b:entier; debut écrire('entrez l 1ere nombre'); lire(a); écrire('entrez l 2eme nombre'); lire(b); tantque (a*b<>0) faire si a>0alors a:=a-b fsi; si a<0 alors b:=b-a fsi; ftq; si a=0 alors écrire('pgcd=',b) sinon écrire('pgcd=',a) fsi; fin. |
Answered on 18:26, Saturday 11 Nov 2017 by نسرين ولهي |
Answer (17)
0 votes
|
algorithme pgcd ; var a,b : entier ; debut ecrire( ' donnez les 2 nmbrs') ; lire( a,b) ; tanque a <> b faire si a >b alors a := a-b sinon b:= b -a ; ftq; si a>b alors ecrire( ' le pgcd est', a); sinon ecrire ( le pgcd est ' , b) ; fin . |
Answered on 01:52, Friday 17 Nov 2017 by Amani Haraoubia (47 points) |
Answer (18)
0 votes
|
Algorithme pgcd; var a,b,c,i:entier; debut lire(a,b); si a < b alors c:=b; b:=a; a:=c; fsi; repeter c:=a mod b; a:=b; b:=c; jusqu à c=0 ; ecrire(b); fin. |
Answered on 18:41, Wednesday 22 Nov 2017 by Islam Yagoub |
Answer (19)
0 votes
|
algorithme pgcd; var a,b,c:entier; debut lire(a,b); si a<b alors c:=a; a:=b; b:=c; finsi tantque b<>0 faire c:=b; b:= a mod b a:=c ftq ecrire('pgcd est ',c); fin. |
Answered on 23:28, Friday 24 Nov 2017 by Khaoula Mokrane |
Answer (20)
0 votes
|
algorithm pGcd; var a,b,c, reste: entier; debut ecrire(' donnez deux nombre'); lire(a,b); si (a<b) alors debut c:=a; b:=a; a:=c; fin; reste:= a mod b; tantqu reste <> 0 faire debut a:= b; b:= reste; reste:= a mod b; fin; ecrire (' le pGcd est ' , b); fin. |
Answered on 11:59, Saturday 25 Nov 2017 by Bouthaina Cheraitia |
Answer (21)
0 votes
|
algorithme pgcd; var a,b:entier; debut écrire('entrez le premier nombre'); lire(a); écrire('entrez le deuzième nombre'); lire(b); tantque (a*b<>0) faire si a>0alors a:=a-b fsi; si a<0 alors b:=b-a fsi; ftq; si a=0 alors écrire('pgcd=',b) sinon écrire('pgcd=',a) fsi; fin. |
Answered on 23:25, Saturday 25 Nov 2017 by rayene ridane |
Answer (22)
0 votes
|
ALGORITHME PGCD; Var x , y : entier ; debut Lire( x,y ) ; TANTQUE x<>y faire Si x>y alors x:=x-y; Sinon y:=y-x; Fsi FTQ Ecrire('PGCD= ' , x ) ;
fin.
|
Answered on 11:41, Friday 1 Dec 2017 by sara younsi |
Answer (23)
0 votes
|
ALGORITHME PGCD ; Var A , B : entier ; debut repeter ecrire(' introduis deux nombre A et B ' ) ; Lire( A,B ) ; jusqua ( ( a>0) et (b>0) ) Tantque A<>B faire Si A>B alors A:=A-B Sinon B:=B-A Fsi FTQ Ecrire('PGCD= ' , A ) ;
Fin.
|
Answered on 17:23, Sunday 3 Dec 2017 by seif eddine touati |
Answer (24)
0 votes
|
Un solution avec pour G7 |
Answered on 20:52, Saturday 23 Dec 2017 by أميرة زمال |