My issue
My code
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int x;
if(x > 10)
{
printf("NO\n");
}
else
{
printf("YES\n");
}
}
return 0;
}
Problem Link: TOP10 Problem - CodeChef
I think server has too much load that’s why its not able to take my submission
and because of that i didn’t check solution is right or not.
Solution in c
#include<stdio.h>
int main(){
int t;
scanf("%d", &t);
while(t--){
int c;
scanf("%d", &c);
if(c > 10){
printf("NO\n");
}
else{
printf("YES\n");
}
}
return 0;
}
solution in c++
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int c;
cin>>c;
if(c>10){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<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 x=sc.nextInt();
if(x>10){
System.out.println("NO");
}else{
System.out.println("YES");
}
}
}
}