题解 2786: 判断能否被3、5、7整除

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

2786: 判断能否被3、5、7整除(c语言解法)

摘要:解题思路:用if - else if - else 来写,括号里面配合&&和||来增加条件注意事项:只有if和else if后面可以加()写条件,else的后面不能加()写条件参考代码:#includ……

2786: 判断能否被3、5、7整除

摘要:解题思路:不用循环,只用条件判断语句注意事项:参考代码:a = int(input())if a % 3 == 0 and a % 5 == 0 and a % 7 == 0:    print(&#……

条件判断写法

摘要:x=int(input())if x%3==0 : print(3,end=' ')if x%5==0 : print(5,end=……

C++简单解法

摘要:解题思路:属于基础题目,我写的是一般的写法,一个一个情况的筛选,可能会比较麻烦注意事项:参考代码:#include<iostream>using namespace……

2786普普通通的解题方法

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); if (n%3 == 0 && n%5== 0 && n%7 =……