Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
###Read problems statements in Russian, Vietnamese, Hindi, Mandarin chinese and Bengali as well.
Chef is interested in the history of SnackDown contests. He needs a program to verify if SnackDown was hosted in a given year.
SnackDown was hosted by CodeChef in the following years: 2010, 2015, 2016, 2017 and 2019.
The first line contain the number of test-cases T.
The first line of each test-case contains a single integer N.
For each test case print a single line containing the string "HOSTED"
if SnackDown was hosted in year NN or "NOT HOSTED"
otherwise (without quotes).
Input:
2
2019
2018
Output:
HOSTED
NOT HOSTED
# cook your dish here
t=int(input())
for i in range(t):
n=input()
a=['2010','2015','2016','2017','2019']
if n in a:
print('HOSTED')
else:
print('NOT HOSTED')
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n ;
cin>>n ;
for(int i=1 ;i<=n ;i++){
int s ;
cin>>s ;
if(s==2010 || s==2015 || s==2016 || s==2017 || s==2019)cout<<"HOSTED"<<endl ;
else cout<<"NOT HOSTED"<<endl ;
}
return 0 ;
}
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int n = sc.nextInt();
if(2010==n||2015==n||2016==n||2017==n||2019==n)
System.out.println("HOSTED");
else
System.out.println("NOT HOSTED");
}
}
}
In our experience, we suggest you solve this Chef and SnackDown CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Chef and SnackDown CodeChef Solution
I hope this Chef and SnackDown CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>