Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7504 - Массивын их

Өгөгдсөн нэг хэмжээст бүхэл тоон массив дахь хамгийн их элементийг / тоог / ол.

Input

Эхний мөрөнд массивын элементийн тоо өгөгдөнө.

Дараагийн мөрөнд массивын элементүүд / бүхэл тоо / зайгаар тусгаарлагдан өгөгдөнө. 

Output

Хамгийн их тоо.

Example

Input:
5
3 -2 4 7 -6
Output:
7

Нэмсэн:Bataa
Огноо:2013-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2022-09-28 13:57:33
ez shde uugan
2022-09-17 17:25:24
s
2022-09-01 12:29:05
#include<stdio.h>
int main ()
{
int num1 ,num2, a[1000], max=0;
scanf("%d", &num1);
for( int i=0; i<num1; i++)
{
scanf("%d", &a[i]);
if(max>a[i])
{
max=max;
}
else if (max<a[i])
{
max=a[i];
}
}
printf("%d", max);
}
Ганзориг Энгүүнбаяр

Last edit: 2022-09-01 12:29:49
2022-08-13 11:15:25
int n = int.Parse(Console.ReadLine());
int[] arr = new int[n];
arr = Array.ConvertAll(Console.ReadLine().Split(' '), Convert.ToInt32);
int max = 0;
for (int i = 0; i < arr.Length; i++)
{
if (max < arr[i])
{
max = arr[i];
}
}
Console.WriteLine(max);
2022-03-29 04:10:14
#include<bits/stdc++.h>
int main(){
int n,i,a[100],max;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&a[i]);

}
max=a[1];
for(i=2;i<=n;i++){
if(a[i]>max)
max=a[i];
else max=max;
}
printf("%d",max);
}
mai duunaraa ahaasan huul
2021-10-08 03:52:47
ASUULUU
2021-03-21 15:08:24
хуулахгүйл дэй
2021-01-30 05:53:21
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, a[101], k;
cin>>n;
for(int i = 1;i <= n; i++){
cin>>a[i];
}
for(int i = 1;i <= n; i++){
for(int j = i+1;j <= n; j++){
if(a[i]>a[j]){
k = a[i];
a[i] = a[j];
a[j] = k;
}
}
}
cout<<a[n];
}
huulahdaa oilgoj huulaarai oisoon?
2020-11-14 18:55:21
#include<stdio.h>
#include<math.h>
int main(){
int n,max;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
max=a[0];
for(int i=1;i<n;i++){
if(a[i]>max){
max=a[i];
}
}printf("%d",max);
return 0;
}
2020-09-04 09:36:40
#include <iostream>
using namespace std;
int main() {
int n;
float numbers[100];
cin >> n;
for (int i=0; i<n; i++){
cin >> numbers[i] ;
}
for(int i=1; i<n; i++){
if(numbers[0] < numbers[i])
numbers[0] = numbers[i];
}
cout << numbers[0];
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.