3 条题解

  • 0
    @ 2024-4-10 23:21:34
    #define int long long
    using namespace std;
    
    
    int gcd(int a,int b){
    	if(b==0){
    		return a;
    	}else{
    		return gcd(b,a%b);
    	}
    }
    
    signed main()
    {
    	
    	int a,b;
    	cin>>a>>b;
    	cout<<gcd(a,b); 
    	return 0;
    }
    
    • 0
      @ 2024-4-9 19:34:26

      #include <bits/stdc++.h>

      using namespace std;

      using ll =long long; ll gcd (ll a,ll b){

      if(b==0){
      	return a;
      }
      return gcd (b,a%b);
      

      }

      int main(){ ll a,b; //主函数力还得定义 cin>>a>>b; cout<< gcd(a,b) <<endl;

      return 0; 
      

      }

      • 0
        @ 2024-4-7 20:18:00

        oi-wiki

        #include <iostream>
        #include <cmath>
        
        using namespace std;
        
        using ll = long long;
        
        ll fxxk(ll a, ll b) {
        	return b == 0 ? a : fxxk(b, a % b);
        }
        
        int main() {
        	ll a, b;
        	cin >> a >> b;
        	cout << fxxk(a, b) << '\n';
        	return 0;
        }
        
        • 1

        信息

        ID
        92
        时间
        1000ms
        内存
        256MiB
        难度
        5
        标签
        递交数
        145
        已通过
        58
        上传者