打印1-100内的素数并统计
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h>int main(){ int a = 0; int i = 0; int count = 0; for (i = 1; i <= 100; i++) { int j = 2; for (j = 2; j < i; j++) { a = i%j; if (a == 0) break; } if (j == i) { count++; printf("%d\n", i); } } printf("共有%d个素数\n", count); return 0;}//打印1-100内的素数