Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef considers the climate HOT
if the temperature is above 20, otherwise he considers it COLD
. You are given the temperature C, find whether the climate is HOT
or COLD
.
For each test case, print on a new line whether the climate is HOT
or COLD
.
You may print each character of the string in either uppercase or lowercase (for example, the strings hOt
, hot
, Hot
, and HOT
will all be treated as identical).
Input: 2
21
16
Output: HOT
COLD
Test case 1: The temperature is 21, which is more than 20. So, Chef considers the climate HOT
.
Test case 2: The temperature is 16, which is not more than 20. So, Chef considers the climate COLD
.
#include <iostream>
using namespace std;
int main() {
int t,c;
cin>>t;
while(t--)
{
cin>>c;
if(c>20)
cout<<"HOT"<<"\n";
else
cout<<"COLD"<<"\n";
}
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i=0;i<t;i++){
int n = sc.nextInt();
if(n>20){
System.out.println("HOT");
}else{
System.out.println("COLD");
}
}
}
}
t=int(input())
for i in range(t):
x=int(input())
if x>20:
print("Hot")
else:
print("Cold")
In our experience, we suggest you solve this Is it hot or cold 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 Is it hot or cold CodeChef Solution
I hope this Is it hot or cold 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 >>