#include <stdio.h>
int isprime(int n)
{
if (n == 1) return 1;
for (int i = 2; i*i <= n; i++)
if (n%i == 0) return 0;
return n > 1;
}
void xuanxian2()
{
int n; int m;
int i, s = 0;
scanf("%d", &n);
scanf("%d", &m);
for (i = n; i <= m; i++){
if (isprime(i)){
printf("%d ", i);
}
}
printf("\n");
}
void xuanxian1()
{
int n,i,total = 1;
scanf("%d", &n);
for (i = 1; i <= n; ++i) total *= i;
printf("%d\n", total);
}
void xuanxian3()
{
int n;
scanf("%d", &n);
if (((n % 400) == 0) || (((n % 4) == 0) && ((n % 100) != 0))){
printf("%d是闰年\n", n);
}
else{
printf("%d非闰年\n", n);
}
}
int main()
{
int index = 2;
printf("1 计算n!\n");
printf("2 输出素数\n");
printf("3 判断闰年\n");
scanf("%d", &index);
switch (index)
{
case 1: xuanxian1(); break;
case 2: xuanxian2(); break;
case 3: xuanxian3(); break;
default: printf("INPUT ERROR!\n");
}
return 0;
}