13黑马币
最佳答案import java.util.Scanner;
class StringDemo
{
public static void main(String[] args)
{
while(true)
{
show();
}
}
public static void show()
{
System.out.print("请输入要判断的字符串:");
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
System.out.println("你输入的是:"+line);
int length = line.length();
//先判断字符串的字符个数是奇数还是偶数
//偶数时
if ...
| |
| |
| |