El mayor de N nĂºmeros
/*
* Created on 06/17/2005
*
*/
package estructura;
/**
* @author vns
*
*/
public class MayorN {
/**
*
*/
public MayorN() {
super();
}
public static void main(String[] args) {
}
public static int mayor( int[] num ){
int mayor = num[0];
for (int i = 0; i < num.length; i++) {
if (num[i] > mayor) {
mayor = num[i];
}
}
return mayor;
}
}
* Created on 06/17/2005
*
*/
package estructura;
/**
* @author vns
*
*/
public class MayorN {
/**
*
*/
public MayorN() {
super();
}
public static void main(String[] args) {
}
public static int mayor( int[] num ){
int mayor = num[0];
for (int i = 0; i < num.length; i++) {
if (num[i] > mayor) {
mayor = num[i];
}
}
return mayor;
}
}
0 Comments:
Post a Comment
<< Home