> 其他 >
编写一个函数来判断某个数是否能被3整除且其中至少有一位数字是4.
人气:203 ℃ 时间:2020-01-27 03:53:56
解答
int panduan(int n)
{
if(n%3!=0)return false;
else
{
while(n%10!=4)
{
n/=10;
}
if(n%4==0)return true;
else return false;
}
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版