当前位置: 代码迷 >> 综合 >> C语言实验——整除 oj
  详细解决方案

C语言实验——整除 oj

热度:91   发布时间:2024-01-14 23:14:53.0

C语言实验——整除

Time Limit: 1000MS  Memory Limit: 65536KB
Submit  Statistic
Problem Description
判断一个数n能否同时被3和5整除。
Input
输入一个正整数n。
Output
如果能够同时被3和5整除,输出Yes,否则输出No。
Example Input
15
Example Output
Yes
 
  
#include <stdio.h>
#include <stdlib.h>int main()
{int a,b,c;scanf("%d",&a);b = a % 3;c = a % 5;if(b == 0&&c == 0){printf("Yes");}else{printf("No");}return 0;
}


  相关解决方案