如题所述
C语言:编写一个程序,判断一个整数的奇偶性。如果是奇数,输出1,是偶数,输出2:
#include <stdio.h>
int main()
{ int n;
scanf("%d",&n);
printf("%d\n",2-n%2);
return 0;
}