标签:
import java.util.Scanner; public class lc2 { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int re=a>b?b:a; for(int i=re;i>0;--i) { if((a%i==0)&&(b%i==0)) { re=i; break; } } System.out.println(re); } }
标签:
原文地址:http://www.cnblogs.com/gbygby/p/5494118.html