java中怎么从字符串中提取字符个数

如题所述

Scanner input = new Scanner(System.in);
System.out.println("请输入要计算的数:");
String yhy = input.next();

String num[] = yhy.split("+");

int a = Integer.parseInt(num[0]);
int b = Integer.parseInt(num[1]);
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜