Access Code Equality
Source: codechef
Difficulty: 355

Access Code Equality
You are attempting to join the Web Club NITK’s exclusive online session. To do so, you need to enter the correct access code.
The correct code is
"WECNITK"
(without quotes).
The code you entered is given by the string$S$, which has length$7$.
Your task is to verify whether the entered code$S$matches the correct code.
If it does, print
"Welcome to Web Club!"
. Otherwise, print
"Access denied"
.
Input Format
The first and the only line of input will contain a string$S$of length$7$, denoting the access code that was entered.
Output Format
Print the correct output according to the access code$S$.
Each letter of the output may be printed in either uppercase or lowercase - for example the string
"AcCeSS DEniEd"
will be accepted if the correct answer is
"Access denied"
.
Constraints
The length of the string$S$is exactly$7$.$S$contains only uppercase and lowercase English letters, i.e. the characters
'a'-'z'
and
'A'-'Z'
.
Sample 1:
Explanation:
The access code entered matches the expected one, so you are granted access.
Sample 2:
Input
Output
WECnitk
Access denied
Explanation:
The access code entered does not match the expected one, so you are not granted access. Note that a mismatch in uppercase/lowercase is still considered a mismatch: the code must match
exactly
.

Sample Input:
WECNITK

Sample Output:
Welcome to Web Club!

C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main(){
    string s;
    cin>>s;

    if(s=="WECNITK")
        cout<<"Welcome to Web Club!"<<endl;
    else
        cout<<"Access denied"<<endl;

    return 0;
}

Go solution:
package main 
import "fmt"
func main(){
    var a string
    fmt.Scanln(&a)
    if a == "WECNITK"{
        fmt.Println("Welcome to Web Club!")
    } else {
        fmt.Println("Access denied")
    }
}

Java solution:
import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner sc = new Scanner(System.in);
        String a=sc.nextLine();
        if(a.equals("WECNITK")){
            System.out.println("Welcome to Web Club!");
        }
        else{
            System.out.println("Access denied");
        }
    }
}

JavaScript solution:
// your code goes here

process.stdin.resume();
process.stdin.setEncoding("utF-8");

let input = "";

process.stdin.on("data" ,function(ch){
    input += ch
})

process.stdin.on("end" , function(){
    let lines = input.trim().split("\n");
    if(lines[0] === "WECNITK" ){
      console.log( "Welcome to Web Club!")
    }else{
         console.log( "Access denied")
    }
})

Python solution:
# cook your dish here
s = input()
a = "WECNITK"
if a == s:
    print("Welcome to Web Club!")
else:
    print("Access denied")

Ruby solution:
begin
  input = gets
  if input.nil?
    puts "Access denied"
  else
    s = input.chomp
    if s == "WECNITK"
      puts "Welcome to Web Club!"
    else
      puts "Access denied"
    end
  end
rescue => e
  puts "Access denied"
end