3725. 陶陶考试

3725. 陶陶考试

Constraints

Time Limit: 1 secs, Memory Limit: 256 MB

Description

 陶陶正在进行考试,他做题时习惯从最难的题目开始做起。试卷上每道题目的难度都用一个整数来表示,他需要从中找到最难的题目的难度。

Input

 有很多测试样例,每个测试样例用两行表示,第一行表示试卷上多少道题目(假设为n道)。下一行包含n个整数,顺序表示试卷上每道题目的难度。当n为0时,输入结束

Output

  每个样例对应输出仅有一个数字的一行,表示最难的难度是多少。

Sample Input

2 5 4

1 8 4 2 6

9 1 4 2 

0

Sample Output

5

8

9

Hint

 程序的输入和输出不冲突 不需要等到程序输入结束再进行输出

// Problem#: 3725

// Submission#: 1984652

// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/

// All Copyright reserved by Informatic Lab of Sun Yat-sen University

#include<iostream>

#include<stdio.h>

#include<string>

#include<cmath>

using namespace std;

int main(){

    int n;

    cin>>n;

    while(n!=0){

        int temp,highest=0,i;

        for(i=0;i<n;i++){

            cin>>temp;

            if(temp>highest){

                highest=temp;

            }

        }

        cout<<highest<<endl;

        cin>>n;

    }

    return 0;

}                                 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值