Pages

Sunday, June 1, 2025

Watermelon in Codeforces(It accepted at 3rd attempt!!)

 #include <iostream>

using namespace std;




int main() {

    int watermelon;

    cin >> watermelon;


    

    if(watermelon == 2) {

        cout << "NO" << endl;

    }

    else if(watermelon%2==0) { // even no;

        cout << "YES" << endl;

    }else { // odd no.

        cout << "NO" << endl;

    }

    

    return 0;

}

No comments:

Post a Comment

Stack using Linked List – Partial (University Exam Topic)

 #include <iostream> using namespace std; struct Node {     int data;     Node* next; }; class Stack {     Node* top; public:     Stac...