我想隨機產生兩個陣列arr1&arr2 之後將其相乘儲存到另一個陣列result 但 我的arr1&arr2 產生的數值是一樣的 且result產生的數值也不對 請問是法方面要修改呢?? public static void main(String[] args) { // TODO Auto-generated method stub System.out.print("Random test"); int[] arr1 = new int[5]; int[] arr2 = new int[5]; int[] result = new int[5]; int i ;
//建立兩陣列相乘 System.out.println("兩陣列相乘得到result陣列"); System.out.print("result=["); for( i=0;i<result.length;i++) { int sum ; sum = arr1[i] * arr2[i]; System.out.print(sum+"\b");
} System.out.print("]");
}
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html
You are receiving this email because you subscribed to this feed at blogtrottr.com.