[C++] AtCoder Beginner Contest 183 A번 ReLU
03 Jan 2021 | PSAtCoder Beginner Contest 183 A번 ReLU
문제
https://atcoder.jp/contests/abc183/tasks/abc183_a
풀이
ReLU를 구현하는 문제 ReLU는 입력값이 0보다 작으면 0으로 출력, 0보다 크면 입력값 그대로 출력하는 함수이다.
코드
#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef tuple<ll,ll,ll> tl3;
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define rep(i, n) FOR(i, 0, n)
#define repn(i, n) FORN(i, 1, n)
#define tc(t) while (t--)
// https://atcoder.jp/contests/abc183/tasks/abc183_a
ll ReLU(ll x){
if(x >= 0) return x;
else return 0;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll x;
cin >> x;
cout << ReLU(x);
return 0;
}