4A - Watermelon || Codeforces
Problem Name: 4A - Watermelon
Judge: Codeforces
Problem link: 4A - Watermelon
Solution on GitHub: 4A - Watermelon
[At first you should try to solve the problem on your own. This will increase your thinking power and the ability to solve the program will increase. And if you copy directly from here, you will not learn anything. So my advice is to try to solve it yourself first. If not then check this code. Once you understand the code, do it yourself. Don't copy from here.
Best of luck]
Codeforces 4A - Watermelon solution 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;
- }
Codeforces 4A - Watermelon solution on C++/Cpp
#include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- if (n <= 2 || n % 2 != 0) cout << "NO" << endl;
- else cout << "YES" << endl;
- return 0;
- }
Codeforces 4A - Watermelon solution on Python
- n = int(input())
- if n <= 2 or n % 2 != 0:
- print("NO")
- else:
- print("YES")
Codeforces 4A - Watermelon solution on Java
- import java.util.Scanner;
- public class Watermelon {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int n = input.nextInt();
- if (n <= 2 || n % 2 != 0) System.out.println("NO");
- else System.out.println("YES");
- }
- }
