Helping Chef||codechef||beginner solution ||programming info

Helping Chef

Write a program, which takes an integer N and if the number is less than 10 then display "Thanks for helping Chef!" otherwise print "-1".

Input

The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N.

Output

For each test case, output the given string or -1 depending on conditions, in a new line.

Constraints

  •  T  1000
  • -20  N  20

Example

Input
3 
1
12
-5
Output
Thanks for helping Chef!
-1
Thanks for helping Chef!
SOLUTION USING C LANGUAGE:-
#include <stdio.h>
int main(void) {
    int T,i,N;
    scanf("%d\n",&T);
    for(i=0;i<T;i++)
    {
        scanf("%d\n",&N);
        if(N<10)
        {
            printf("Thanks for helping Chef!\n");
        }
        else
        {
            printf("-1\n");
        }
    }
	// your code goes here
	return 0;
}

Share:

No comments:

Post a Comment

Translate

Recommended platforms

  1. codechef
  2. hackerrank
  3. codeforces
  4. leetcode
  5. hackerearth

Popular Posts

programming_info. Powered by Blogger.

Blog Archive

Recent Posts

other platforms

  • geeks for geeks
  • w3schools
  • codepen
  • skillshare
  • udemy

Pages

reader support Support