(资料图)
判断一个数n能否同时被3和5整除c语言,判断能否被357整除这个很多人还不知道,现在让我们一起来看看吧!
1、#include using namespace std;void judge(int x, int y){ if(x % y) return 0; cout << x << "能被" << y << "整除" << endl ;}int main(void){ int x = 0; cout << "请输入一个整数" << endl; cin >> x; judge(x, 3); judge(x, 5); judge(x, 7); return 0;}。
本文到此分享完毕,希望对大家有所帮助。
关键词: