You are on page 1of 1

CEL MAI MARE DIVIZOR COMUN - ALGORITMUL LUI EUCLID (metoda impartirilor succesive)

#include<iostream.h> void main() { int a,b,r; cout<<"a=";cin>>a; cout<<"b=";cin>>b; r=a%b; while(r) { a=b; b=r; r=a%b; } cout<<"cmmdc: "<<b; }

You might also like