输入一个程序,输入一个整数,判断它们能不能被5或8整除,若能,输出“yes”,否则输出“no”
来源:百度知道 编辑:UC知道 时间:2024/05/06 12:04:45
那位高手帮帮忙吧!我真的是不会啊!!!!!
#include<stdio.h>
void main()
{
int a;
printf("Input:\n");
scanf("%d",&a);
if(a%5==0&&a%8==0) printf("yes");
else printf("no");
}
如果是用VF:
set talk off
clear
input "请输入一个数: " to a
if int(a/5)=a/5 .or. int(a/8)=a/8
s="y"
else
s="n"
endif
if s="y"
?"yes"
endif
if s="n"
?"no"
endif
set talk on
close all
return