public class Homework{

 

public static void main(String[]args){

String a = "ja456va p5465hp java458script <div>465</div>";

 Pattern s = Pattern.compile("\\d+");

Matcher n = s.matcher(a);

int sum = 0;

while (n.find()){

int num = Integer.valueOf(n.group());

sum +=num;

}

System.out.println(sum);

}

}

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2021-08-26
  • 2021-10-29
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-14
  • 2021-06-05
  • 2022-12-23
  • 2021-09-10
  • 2021-05-23
  • 2021-11-17
相关资源
相似解决方案