如何用C语言解决该题?

用循环语句查找并输出 10 ~ 1000 范围内同时能被 4 和 9 整除的数。
输出的每个数据域宽为 6,每行最多输出 6 个数据。
输出完成后,在新的一行输出满足条件的数据个数。


#include <stdio.h>

int main()
{
    int count = 0; // 记录满足条件的数据个数
    for (int i = 10; i <= 1000; i++) // 循环遍历 10 ~ 1000 范围内的数
    {
        if (i % 4 == 0 && i % 9 == 0) // 判断是否能被 4 和 9 整除
        {
            printf("%6d", i); // 输出数据,域宽为 6
            count++; // 增加计数器
            if (count % 6 == 0) // 每输出 6 个数据换行
            {
                printf("\n");
            }
        }
    }
    printf("\n%d\n", count); // 输出满足条件的数据个数
    return 0;
}
#include<stdio.h>

int main()
{
    int i,count=0;   // count表示符合条件的数的个数
    printf("The numbers that can be divided by 4 and 9 at the same time in the range of 10 to 1000 are:\n");
    for(i=10;i<=1000;i++)
    {
        if(i%4==0 && i%9==0)
        {
            printf("%-6d",i);
            count++;
            if(count%6==0)
                printf("\n");
        }
    }
    printf("\n");
    printf("The total number of desired numbers is: %d",count);
    return 0;
}

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^