题解 | #牛牛的二三七整除#

牛牛的二三七整除

https://www.nowcoder.com/practice/b2cf0b791245436f8f0591ae9f4c664f

public class Program{
    public static void Main()
    {
        int Input = System.Convert.ToInt32(System.Console.ReadLine());

        string OutPut="";
        if(Input%2==0)
        OutPut+="2";

        if(Input%3==0)
        {
            if(OutPut!="")
            OutPut+=" 3";
            else
            OutPut+="3";
        };

        if(Input%7==0)
        {
            if(OutPut!="")
            OutPut+=" 7";
            else
            OutPut+="7";
        };

        if(OutPut=="")
        System.Console.WriteLine("n");
        else
        System.Console.WriteLine(OutPut);
    }
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务