Official

A - ReLU Editorial by evima


If you are new to programming and do not know what to start with, first try Problem A “Welcome to AtCoder” in “practicecontest”(https://atcoder.jp/contests/practice/). There you can find a sample code for each language.

In this problem, you have to perform a conditional branch depending on whether \(X\) is more than or equal to \(0\) or not. Check out how to write a conditional branch (if statement) in each language.

Sample Code (Python)

X = int(input())

if X >= 0:
	print(X)
else:
	print(0)

Sample Code (C++)

#include <iostream>
using namespace std;

int main(){
	int X;
	cin >> X;
	if(X >= 0){
		cout << X;
	}else{
		cout << 0;
	}
}

Sample Code (C)

#include<stdio.h>

int main(){
	int X;
	scanf("%d", X);
	
	if(X>=0){
		printf("%d", X);
	}else{
		printf("0");
	}
}

posted:
last update: