Codeforces Solution 4A-Watermelon - Solution in C, C++ | Math - Online Judge Solution

Latest

It is a free Online judges problems solution list. Here you can find UVA online Judge Solution, URI Online Judge Solution, Code Marshal Online Judge Solution, Spoz Online Judge Problems Solution

Tuesday, May 2, 2017

Codeforces Solution 4A-Watermelon - Solution in C, C++ | Math

Codeforces Solution 4A-Watermelon - Solution in C++ | Math


CodeForces Online Judge Solution  |
CodeForces Main Problem Link - http://codeforces.com/problemset/problem/4/A

Problem Name: CodeForces Problem 4A-Watermelon
Problem Number : CodeForces Problem 4A-WatermelonSolution
Online Judge : CodeForces Online Judge Solution
Category: Math
Solution Language : C plus plus

CodeForces Solution 4A-Watermelon Code in CPP:


#include <iostream>
using namespace std;

int main(){
    int w = 0; cin >> w;
    string output = (w <= 2 || w % 2) ? "NO" : "YES";
    cout << output << endl;
    return 0;
}

CodeForces Solution 4A-Watermelon Code  in C


#include<stdio.h>

int main(){
    
    int n;
    scanf("%d", &n);
    if(n <= 2 || n%2 != 0){
        printf("NO\n");
    }
    else{
        printf("YES\n");
    }
    
    return 0;
}

No comments:

Post a Comment