编程介的小学生 2017-12-02 03:10 采纳率: 20.5%
浏览 975
已采纳

Max Num

Problem Description
There are some students in a class, Can you help teacher find the highest student .

Input
There are some cases. The first line contains an integer t, indicate the cases; Each case have an integer n ( 1 ≤ n ≤ 100 ) , followed n students’ height.

Output
For each case output the highest height, the height to two decimal plases;

Sample Input
2
3 170.00 165.00 180.00
4 165.00 182.00 172.00 160.00

Sample Output
180.00
182.00

  • 写回答

1条回答 默认 最新

  • 关注
     #include "iostream"
    using namespace std;
    int main()
    {
        int n ;
        cin>>n;
        double res = 0;
        cout.setf(ios::fixed);
        cout.precision(2);
        for(int i = 0;i<n;i++)
        {
            int m;
            cin>>m;
            double s[m];
            for(int j=0;j<m;j++)
            {
                cin>>s[j];
                if(s[j]>res)
                    res = s[j];
            }
            cout<<res<<endl;
        }
    }
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据