【初心者】Java質問・相談スレッド123【歓迎】
at TECH
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