case 2:
System.out.println("请输入一个正数, 你可以得0到这个数之间有多少素数");
int num1 = sc.nextInt();
int count =0;
for (int x=1;x<=num1 ;x++ )
{
int y = 2;
while (y<x)
{
if (x%y==0)
{
break;
}
y++;
}
if(x==y)
count++;
}
System.out.println("素数共有"+count+"个!");
System.out.println("..................");
break;
case 3:
System.out.println("让用户输入一个1到10的整数n,正三角星星图形");
int num3 = sc.nextInt();
for (int x=0;x<num3 ;x++ )
{
for (int y=0;y<=x ;y++ )
{
System.out.print("*");
}
System.out.println();
}
System.out.println("..................");
break;
case 4:
for (int x=1;x<=9 ;x++ )
{
for (int y=1;y<=x ;y++ )
{
System.out.print(y+"*"+x+"="+y*x+"\t");
}
System.out.println();
}
System.out.println("..................");
break;
case 5:
break w;
default:
System.out.println("请重新输入选项:");
}
}
}
else
System.out.println("密码错误!");
}
}
}