The Goal:
In this exercise, you have to analyze records of temperature to find the closest to zero.
Sample temperatures Here, -1 is the closest to 0.
Rules:
Write a program that prints the temperature closest to 0 among input data. If two numbers are equally close to zero, positive integer has to be considered closest to zero (for instance, if the temperatures are -5 and 5, then display 5).
我的代码:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
vector<int> element;
int search(vector<int> &sch){