说了多少次,外面要叫坤哥,需要求奇数把偶数屏蔽掉,需要偶屏蔽奇数就行了
#pragma warning(disable:4996)标签:求坤,奇数,int,偶数,includeint,printf,屏蔽掉 From: https://blog.51cto.com/u_15880518/5870623
#include<stdio.h>
int main()
{
int n;
int a;
printf("请输入a:");
scanf("%d", &a);
for (n = 1;n <= a;n++){
if (n % 2 == 1) {
printf("%d—为坤数\n",n);
}
if (n % 2 == 0) {
printf("%d—为偶数\n",n);
}
}
return 0;
}