File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ // /Largest element of an Array using STL
2
+
3
+ /* *
4
+ *
5
+ * author :: 101rror
6
+ *
7
+ **/
8
+
9
+ #include < bits/stdc++.h>
10
+
11
+ using namespace std ;
12
+
13
+ #define MAX 100
14
+ #define infinity 1000000000000000LL
15
+ #define all (x ) (x).begin(),(x).end()
16
+ #define FastRead ios::sync_with_stdio (0 ); cin.tie(0 ); cout.tie(0 );
17
+ #define mod (x,m ) ((x%m)+m)%m; // 101rror
18
+ #define fastread () (ios_base:: sync_with_stdio(false ),cin.tie(NULL ))
19
+
20
+ #define T while (t--)
21
+ #define for2 (i,a,b ) for (i=a;i>=b;i--)
22
+ #define for3 (i,a,b ) for (i=a;i<=b;i=i+2 )
23
+ #define for1 (i,a,b ) for (i=a;i<=b;i=i+1 )
24
+ #define for4 (i,a,b ) for (i=a;i>=b;i=i-2 )
25
+
26
+ #define fi first
27
+ #define se second
28
+ #define pb push_back
29
+ #define eb emplace_back
30
+
31
+ #ifdef LOCAL
32
+ #include " algo/debug.h"
33
+ #else
34
+ #define debug (...) 42
35
+ #endif
36
+
37
+
38
+ int main ()
39
+ {
40
+ ios::sync_with_stdio (false );
41
+ cin.tie (0 );
42
+ fastread ();
43
+
44
+ int i, num;
45
+ cin >> num;
46
+
47
+ int array[num];
48
+
49
+ for (i = 0 ; i < num; i++)
50
+ {
51
+ cin >> array[i];
52
+ }
53
+
54
+ sort (array, array + num);
55
+
56
+ int Largest = *max_element (array, array + num);
57
+
58
+ cout << endl;
59
+ cout << " The Largest Element is : " << Largest;
60
+ cout << endl;
61
+
62
+
63
+ return 0 ;
64
+ }
You can’t perform that action at this time.
0 commit comments