【初心者】Java質問・相談スレッド123【歓迎】 at TECH
[2ch|▼Menu]
325:デフォルトの名無しさん
09/02/01 16:28:10
>>321
public class sample{
public static void main(String[] args){
int i [] ={6,5,4,3,2};
System.out.println("最大値" + sample(i));
}
static int sample(int[] array){
int max = array [0];
for (int i = 1; i < array.length; i++){
max = Math.max( max, array [i]);
}
return max;
}
}

こんな感じに習ったんじゃないか?


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5066日前に更新/227 KB
担当:undef