Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- #define ll long long
- #define ull unsigned long long
- #define pi 3.14159
- //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- using namespace std;
- void yasmeen_fakhri(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- ll maxx = INT_MIN;
- ll max_number(ll arr[] , ll n){
- if (n<0 ) return 0;
- if (arr[n] > max_number(arr , n-1) )
- maxx = arr[n];
- return maxx;
- }
- int main() {
- yasmeen_fakhri();
- int test =1;
- //cin>>test;
- while(test--){
- ll n; cin>>n;
- ll arr[n];
- for(int i =0 ; i<n ; i++){
- cin>>arr[i];
- }
- cout<< max_number(arr , n-1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement