-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathThatismyscorecc.java
executable file
·71 lines (55 loc) · 1.75 KB
/
Thatismyscorecc.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import java.util.*;
public class Main
{
public static void main(String args[])
{ int i, t =0;
Scanner sc = new Scanner(System.in);
System.out.println("enter the no of test cases:")
int t = sc.nextInt();
while(t--)
{
System.out.println("enter the no of submissions:");
int n =sc.nextInt();
int no = new int[n];
int so = new int[n];
for(i=0;i<n;i++)
{
System.out.println("The first no. tells the number of the submission and the second its score:");
int n1 =sc.nextInt();int s =sc.nextInt();
no[i]=n1;so[i]=s;
}
for(i=0;i<n;i++)
{
for(x=i+1;x<n;x++)
{
if(no[i]>no[x])
{
c=no[i];
no[i]=no[x];
no[x]=c;
c=so[i];
so[i]=so[x];
so[x]=c;
}
}
}
int m=0;
while(no[m]==no[m+1])
{
jip[m]=so[m];
m++;
}
max = jip[0];
for(int i = 0; i < jip.length; i++)
{ if(no[i]!=9&&no[i]!=10&&no[i]!=11)
{
if(max < jip[i])
{
max = jip[i];
}
}
}
total=total+max;
}
}
}