编辑代码

#include <stdio.h>
int main () {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
    int x = 2;
    int count = 0;

    while (count < 100) {
        int i, isPrime = 1;
        for (i = 2; i < x; i++) {
            if (x % i == 0) {
                isPrime = 0;
                break;
            }
        }
        if (isPrime == 1) {
            count++;
            printf("\n%d: %d 是素数", count, i);
        }
        x++;        
    }

    return 0;
}