輸入一個字符串,對字符串中的數字進行求和

代碼: package cn.tedu.string; public class StringText2 { public static void main(String[] args) { //字符串對象 String str=「erhg2309wefb4521」; //求和變量 int sum=0; //遍歷字符串 for(int i=0;i<str.length();i++){ //獲取每個
相關文章
相關標籤/搜索