标签:sha oss log images 练习 ado pre 解法 proc
题目:打印3的倍数 int main()
{
int i = 0;
int count = 0;
for (i = 1; i <= 100; i++)
{
if (i % 3 == 0)
{
printf("%d ", i);
count++;
}
}
printf("\nconut=%d\n", count);
return 0;
}
运行结果
![](https://s4.51cto.com/images/blog/202010/31/d9decfe0174eb8081759f4dd2dacef37.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
解法二
```
int main()
{
int a = 1;
int count = 0;
while (a <= 100)
{
if (a % 3 == 0)
{
printf("%d ", a);
a++;
count++;
}
else
a++;
}
printf("\nconut=%d\n", count);
return 0;
}
运行结果
![](https://s4.51cto.com/images/blog/202010/31/6c3aed517bd16348d905ae33db2590e3.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
标签:sha oss log images 练习 ado pre 解法 proc
原文地址:https://blog.51cto.com/14950896/2545747