Skip to content

Instantly share code, notes, and snippets.

@devetude
Last active September 22, 2016 14:48
Show Gist options
  • Save devetude/42f0fa57db525fbf0632750d31fff16b to your computer and use it in GitHub Desktop.
Save devetude/42f0fa57db525fbf0632750d31fff16b to your computer and use it in GitHub Desktop.
순차탐색 알고리즘 1 (Sequential Search 1)
import java.util.Scanner;
/**
* 순차탐색 알고리즘 1 (Sequential Search 1)
*
* @author devetue
*/
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int max = -999999999;
for (int i = 0; i < N; i++) {
int n = sc.nextInt();
if (max < n) {
max = n;
}
}
System.out.println(max);
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment