用C语言写500以内能被3或5整除的数

可以用以下代码:

for (int i = 0; i <= 500; i++) { if (i % 3 == 0 || i % 5 == 0) { printf("%d\n", i); } }

猜你喜欢

转载自blog.csdn.net/weixin_35755562/article/details/129525258