boolean m=true;
while (m) {
System.out.println("请输入要加密的数据,输入stop就跳出while");
String s =input.next();
BigInteger y=new BigInteger(s);
BigInteger s1=paillier.En(y);
System.out.println(s+"加密的结果是"+s1);
加一段代码块:
if (s == "stop")
{
break;
}
在 String s = input.next(); 的下一行加入
String s =input.nextLine();
if (s.equals("stop")) break;
String s =input.next();下面加上
if(s==“stop”){
break;
}