1 条题解

  • 0
    @ 2025-11-30 16:26:19

    C++ :

    #include <iostream>
    #include <cstdio>
    using namespace std;
    int main()
    { int i,n,a[100];
      scanf("%d",&n);
      for (i=1;i<=n-1;i++) scanf("%d",&a[i]);
      scanf("%d",&a[n]);
      for (i=1;i<=n-1;i++) 
        if (a[i]>a[n]) a[n]=a[i];
      printf("%d",a[n]);
      //system("pause");
      return 0;
    }
    
    
    
    

    Python :

    # coding=utf-8
    k = int(input())
    num_list = input().split(' ')
    max = int(num_list[0])
    for num in num_list:
        if num.strip().isdigit():
            if int(num) > max:
                max = int(num)
    print(max)
    
    • 1

    信息

    ID
    1171
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者