求绝对值最大值
Description
求n个整数中的绝对值最大的数。
Input
输入数据有2行,第一行为n,第二行是n个整数。
Output
输出n个整数中绝对值最大的数。
#include<iostream>
using namespace std;
int main()
{
int a,i=1,b,c,max=0,e;
cin>>a;
while(i<=a)
{
cin>>b;
i++;
if(b<0)
c=-b;
else
c=b;
if(c>=max)
原创
2020-08-07 17:31:59 ·
303 阅读 ·
0 评论