3 solutions

  • 1
    @ 2025-11-16 18:18:26
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    { 
      int n; cin>>n;
      int maxv; 
      for(int i=1;i<=n;i++)
        { 
          int x; cin>>x; if(i==1||x>maxv) 
          { 
            maxv=x; 
          } 
        } 
      cout<<maxv;
      return 0;
    }
    
    • -2
      @ 2025-8-5 14:45:11

      #include<bits/stdc++.h> using namespace std; int n; int main(){ cin>>n; int t; int maxn=0; for(int i=1;i<=n;i++){ cin>>t; if(t>maxn){ maxn=t; } } cout<<maxn; return 0; }

      • -2
        @ 2024-12-11 20:26:30

        #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int maxv; for(int i=1;i<=n;i++) { int x; cin>>x; if(i==1||x>maxv) { maxv=x; } } cout<<maxv; return 0; }

        • 1

        Information

        ID
        873
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        1
        Tags
        (None)
        # Submissions
        185
        Accepted
        87
        Uploaded By