s
o
u
l
s
j
i
e

C语言判断一个数能否被3和5整除

#include <stdio.h>
/*
判断一个数能不能同时被3和5整除
--------soulsjie 20170525-----
*/
void main(){
        int input;
        printf("请输入一个数:");
        scanf("%d",&input);
        if(input%3==0 && input%5==0)
        {
            printf("%d能同时被3和5整除!\n",input);
        }
        else{printf("%d不能同时被3和5整除",input);}

}

 

posted @ 2017-05-25 17:49  soulsjie  阅读(4274)  评论(0编辑  收藏  举报
你累吗?累就对了,当你觉得累时证明你在走上坡路!-----NotFoundObject - 2016-12-14 08:43