1. 程式人生 > >使用一個數組存儲一個英文句子"java is an object oriented programing language"

使用一個數組存儲一個英文句子"java is an object oriented programing language"

program int code 數組 ati println ava oid 一個

class fun 
{
    public static void main(String[] args) 
    {
        String str="java is an object oriented programming language";
        String[] strs = str.split(" ");
        int sum = 0;
        for(int i=0;i<strs.length;i++)
        {
            sum += strs[i].length();
            System.out.println(strs[i]
+" "); } } }

使用一個數組存儲一個英文句子"java is an object oriented programing language"