编辑代码

#include <stdio.h>

int main() {
    // 使用 for 循环
    printf("使用 for 循环输出 100 以内能被 7 整除的数:\n");
    for (int i = 0; i < 100; i += 7) {
        printf("%d ", i);
    }
    printf("\n");

    // 使用 while 循环
    printf("使用 while 循环输出 100 以内能被 7 整除的数:\n");
    int j = 0;
    while (j < 100) {
        printf("%d ", j);
        j += 7;
    }
    printf("\n");

    return 0;
}