eu1.cppの変更点
- 追加された行はこのように表示されます。
- 削除された行は
このように表示されます。
// ユークリッドの互除法(再帰版)
#include <iostream>
using namespace std;
int gcd ( int x, int y )
{
if(y==0){
return x;
}else{
gcd(y,x%y);
}
}
int main()
{
int a,b;
cout << "a:";
cin >> a;
cout << "b:";
cin >> b;
cout << "GCD=" << gcd(a,b) << endl;
return 0;
}