Skip to content

Instantly share code, notes, and snippets.

@modos
Created July 8, 2022 20:06
Show Gist options
  • Save modos/eb23b70959ca3dd1b26f2461464d0981 to your computer and use it in GitHub Desktop.
Save modos/eb23b70959ca3dd1b26f2461464d0981 to your computer and use it in GitHub Desktop.
ماکزیمم
import java.util.Scanner;
public class Main {
public static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int n = sc.nextInt();
int nn = 0;
int max = 0;
for (int i=1; i<=n; i++) {
nn = sc.nextInt();
if(max < nn)
max = nn;
}
System.out.println(max);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment