Duke Zhou

C++ can also use scanf and printf to input and output, which is not easy to make mistakes. The greatest common divisor uses Euclid's phase division pseudocode as follows:

# include & ltiostream & gt

# include & ltstdlib.h & gt

Use? Namespace? std

int? Master ()

{

int? m,n,m_cup,n_cup,res

CIN & gt; & gtm & gt& gtn;

If (m? & gt? 0? & amp& amp? n? & gt? 0)

{? m _ cup = m

n _ cup = n

res = m _ cup % n _ cup

while(res! =0)

{?

m _ cup = n _ cup

n _ cup = res

res = m _ cup % n _ cup

}

cout & lt& ltn _ cup & lt& lt'?' & lt& ltm * n/n _ cup;

}

other

Cout & lt& lt "Wrong!" & lt& ltendl

System ("suspended");

Return? 0;

}