zoukankan      html  css  js  c++  java
  • 训练1-U

    输入2个正整数A,B,求A与B的最小公倍数。

    Input 2个数A,B,中间用空格隔开。(1<= A,B <= 10^9) Output 输出A与B的最小公倍数。 Sample Input
    30 105
    Sample Output
    210
    #include<stdio.h>
    int main()
    {
    	int gcd(long long int a,long long int b);
    	long long int A,B;
    	scanf("%lld%lld",&A,&B);
    	printf("%lld
    ",A*B/gcd(A,B));
    	return 0;
    	
    }
    int gcd(long long int a,long long int b)
    {
    	return b==0?a:gcd(b,a%b);
    }

    ...

  • 相关阅读:
    Git Bash关键命令
    一个不需要Log4Net的写日志的简单方法
    未知软件
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
  • 原文地址:https://www.cnblogs.com/aerer/p/9931096.html
Copyright © 2011-2022 走看看