精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • java 求最大公約數(shù),最小公倍數(shù)

    java 求最大公約數(shù),最小公倍數(shù)
    利用輾轉(zhuǎn)相除法求兩個(gè)整數(shù)的最大公約數(shù)和最小公倍數(shù).注意,這里只寫一個(gè)方法求最大公約數(shù),最小公倍數(shù)放到main方法中完成.
    import java.util.Scanner;
    public class Chpt7_4 {
    public static int fun1(int a1,int b1)
    { int c;
    c=a1%b1;
    while (c>0)
    {a1=b1;
    b1=c;
    c=a1%b1;
    return (b1);
    }
    }
    public static void main(String[] args) {
    int a,b,temp;
    int m;
    Scanner in=new Scanner(System.in);
    a=in.nextInt();
    b=in.nextInt();
    if(a
    其他人氣:383 ℃時(shí)間:2019-10-17 03:22:47
    優(yōu)質(zhì)解答
    import java.util.Scanner;
    public class C{
    public static int fun1(int a1,int b1){
    int c;
    c=a1%b1;
    while (c>0)
    {a1=b1;
    b1=c;
    c=a1%b1;
    //return b1;
    }
    return b1; //把return寫在這里;
    }
    public static void main(String[] args) {
    int a,b,temp;
    int m;
    Scanner in=new Scanner(System.in);
    a=in.nextInt();
    b=in.nextInt();
    if(a
    我來回答
    類似推薦
    請(qǐng)使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版