Superwen


私信TA

用户名:dotcpp0721896

访问量:225

签 名:

一只努力尝试的小笨鸟

等  级
排  名 3128
经  验 1953
参赛次数 0
文章发表 8
年  龄 0
在职情况 学生
学  校 山西农业大学
专  业

  自我简介:

TA的其他文章

解题思路:  遍历大于二的整数满足条件则输出
注意事项:  变量的有效范围!!(被困二十分钟)

参考代码:

import java.util.Scanner;


public class Main {

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

while (scanner.hasNext()) {

int a = scanner.nextInt();

int b = scanner.nextInt();

int c = scanner.nextInt();

boolean go = true;

while(go){

    int x=0;

    for(int i=2;i>0;i++){

        int a0=a%i;

        int b0=b%i;

        int c0=c%i;

         x = i;

        if(a0==b0&&b0==c0){

            go = false;

            break;

        }

        else{

            continue;

        }

    }

    System.out.println(x);

}

}

}

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区