求一个算法zz

输入一个整数,判断其能否被357整除,并输出以下信息之一:

          能被357整除

          能被  3整除

          能被  3整除

          能被  5整除

          能被   3    整除

          能被   5    整除

          能被   7    整除

          不能被357中任何一个数整除

 

慕运维8527718
浏览 1162回答 2
2回答

Smile4112655

#include <stdio.h> int main(){ int a; scanf("%d", &a); if(a % 3 == 0 && a % 5 == 0 && a % 7 == 0){ printf("能被3、5、7整除\n"); } else if(a % 3 == 0 && a % 5 == 0 ){ printf("能被  3、5  整除\n"); } else if(a % 3 == 0  && a % 7 == 0){ printf("能被  3、7  整除\n"); } else if(a % 5 == 0 && a % 7 == 0){ printf("能被  5、7  整除\n"); } else if(a % 3 == 0 ){ printf("能被   3    整除\n"); } else if(a % 5 == 0 ){ printf("能被   5    整除\n"); } else if(a % 7 == 0){ printf("能被   7    整除\n"); } else { printf("不能被3、5、7中任何一个数整除\n"); } return 0; }你应该要的是这个吧,有什么不明白的可以问我。

慕瓜9220888

GUKGVJMYSPGYXZIRBLKLNMNNGDTWNLFHDXAMHRWYKGQWGJDCRJPZPVYZQPRDNJZUIESBUHNJNRNSXATADPMRGSADWGBSHZOZCVUGRJYZZJZFKBTSPFSSOSDAWEOXKXGXZEFHUDNNXGUWBRHNDYNOXPBBHDOWYVEHKURSAMHQXYSULDVAGSIVYTLAVTDGSIZIFURBNHYSRQIHAXXQRRMIBXXUJRTYZMGSMGEZLATMZJINLGPLLVJABJHJZWERKOKCAXHXQALQLKKNMTMUQOQTCSMEVXUWJIFIFTLZFVRKUEIAPHXKGWOCINIIWDTDRMLARYCWZWSHZCVIRRMOGXQTTNISTZRKTGGGHZOGATJFKRWIAWZFLNRSSEUQJDBMOTLGTCMGQIXRBUAGPDBDVLYRTNUBZLUUXQOVFUGGJMFRINZFYBRXXYNWOURNAYDVAFLIIYXYAFBHUPOTKMNCFIKALCODEQTZFSABAFPYLVZASYQJCVZGEWOLHBUUOFBWEGSMVSTXVDAQTGZKFXUXQWJWNFRCZYYSCDETCGGMCVNLTXTKG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