#14047: C++的福利阿


cute60814 (悠悠)


似乎在C++內有個函式庫叫algorithm,

又其中有個函示叫做__gcd,

故得證

(所以這題也不用用到迴圈去寫輾轉相除啦!!!!

#14914: Re:C++的福利阿


reina42689 (職業岩龍騎手)


Python的gcd調用方法:

from math import gcd

 

#15065: Re:C++的福利阿


wish.rirf@gmail.com (C++ 與我)


似乎在C++內有個函式庫叫algorithm,

又其中有個函示叫做__gcd,

故得證

(所以這題也不用用到迴圈去寫輾轉相除啦!!!!


#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
  unsigned int a,b;
  while(cin>>a>>b){
  cout << endl << std::__gcd(a,b);
}
  return 0;
}

#15363: Re:C++的福利阿


yanyang0728@gmail.com (yang yan)


似乎在C++內有個函式庫叫algorithm,

又其中有個函示叫做__gcd,

故得證

(所以這題也不用用到迴圈去寫輾轉相除啦!!!!


#include
#include
using namespace std;
int main()
{
  unsigned int a,b;
  while(cin>>a>>b){
  cout << endl << std::__gcd(a,b);
}
  return 0;
}


請問這是甚麼意思?看不太懂