File tree Expand file tree Collapse file tree 8 files changed +110
-0
lines changed Expand file tree Collapse file tree 8 files changed +110
-0
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+ class CandidateCode {
3
+ public static final Scanner cin =new Scanner (System .in );
4
+ public static void main (String [] args ){
5
+ int t =cin .nextInt ();
6
+ while (t !=0 ){
7
+ int n =cin .nextInt ();
8
+ gameBlock (n );
9
+ t --;
10
+ }
11
+ }
12
+ public static void gameBlock (int n ){
13
+ int [] st =new int [n ];
14
+ int [] en =new int [n ];
15
+ for (int i =0 ;i <n ;i ++){
16
+ st [i ]=cin .nextInt ();
17
+ }
18
+ for (int i =0 ;i <n ;i ++){
19
+ en [i ]=cin .nextInt ();
20
+ }
21
+ int sums =0 ,sume =0 ;
22
+ Arrays .sort (st );
23
+ Arrays .sort (en );
24
+ int count =0 ;
25
+ for (int i =0 ;i <n ;i ++){
26
+ // sums=sums+st[i];
27
+ //sume=sume+en[i];
28
+ //System.out.println(st[i]+ " " + en[i]);
29
+ if (en [i ]>=st [i ]){
30
+ count ++;
31
+ }
32
+ }
33
+ if (count ==n ){
34
+ System .out .println ("WIN" );
35
+ }
36
+ else {
37
+ System .out .println ("LOSE" );
38
+ }
39
+ }
40
+
41
+ }
42
+
Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+ public class FirstUpper {
3
+ public static void main (String [] args ){
4
+ Scanner cin =new Scanner (System .in );
5
+ String s1 =cin .nextLine ();
6
+ String s3 ;
7
+ for (int i =0 ;i <s1 .length ();i ++){
8
+ s3 =
9
+ String s2 =s1 .charAt (0 );
10
+
Original file line number Diff line number Diff line change
1
+ import java .util .Scanner ;
2
+ class MembershipString {
3
+ public static void main (String [] args ){
4
+ Scanner cin =new Scanner (System .in );
5
+ String s1 =cin .nextLine ();
6
+ char c =cin .next ().charAt (0 );
7
+ int i =0 ;
8
+ boolean check =false ;
9
+ while (i <s1 .length ()){
10
+ if (s1 .charAt (i )==c ){
11
+ check =true ;
12
+ }
13
+
14
+ i ++;
15
+ }
16
+ if (check ){
17
+ System .out .print ("Yes" );
18
+ }
19
+ else {
20
+ System .out .println ("No" );
21
+ }
22
+ }
23
+ }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+ #include <math.h>
3
+ void primeFact (long );
4
+ int main (void ){
5
+ long n ;
6
+ printf ("Enter the Number to find the primeFactors: " );
7
+ scanf ("%ld" ,& n );
8
+ primeFact (n );
9
+
10
+ }
11
+ void primeFact (long n ){
12
+ int count ;
13
+ for (long i = 2 ;i <=sqrt (n );i ++ ){
14
+ if (n %i == 0 ){
15
+ count = 0 ;
16
+ while (n %i == 0 ){
17
+ n /=i ;
18
+ count ++ ;
19
+ printf ("%ld\n" ,i );
20
+
21
+ }
22
+ }
23
+ }
24
+ if (n != 1 ){
25
+ printf ("%ld" ,n );
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+ class Upper {
3
+ public static void main (String [] args ){
4
+ Scanner cin =new Scanner (System .in );
5
+ String s1 =cin .nextLine ();
6
+ System .out .print (s1 .toUpperCase ());
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments