4 solutions

  • 3
    @ 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;
    }
    
    • 0
      @ 2026-6-28 15:08:01
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int a;
          cin>>a;
      	int maxv;
      	for(int i=1;i<=a;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
          241
          Accepted
          111
          Uploaded By