- public class jva106
- {
- public static void main(String arg[])
- {
- int tot=0;
- int isn=0;
- int non=0;
- for(int i=0;i<arg.length;i++)
- {
- try{
- tot=tot+Integer.parseInt(arg[i]);
- isn++;
- }catch(Exception e){
- non++;
- }
- }
- System.out.println("數值之總和為:"+tot);
- System.out.println("非數值個數為:"+non);
- System.out.println("純數之個數為:"+isn);
-
- }
- }
複製代碼 救命!!!!!!!!為什麼不能執行
* h3 H( ~* z; L' J6 c阿阿阿阿阿阿阿阿阿阿阿阿 |