-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaltmış_ogrenci_icerisinden_gecen_ve_kalanlarin_adedi.cs
51 lines (43 loc) · 1.35 KB
/
altmış_ogrenci_icerisinden_gecen_ve_kalanlarin_adedi.cs
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
Random rastgele = new Random();
double enb = 0,ort=0,bn=0,g=0,k=0;
double s1, s2, s3;
for (int i = 1; i <= 60; i++)
{
s1 = rastgele.Next(1,101);
s2 = rastgele.Next(1,101);
s3 = rastgele.Next(1,101);
if (s1 > s2 && s1 > s3)
{
enb = s1;
}
else if (s2 > s1 && s2 > s3)
{
enb = s2;
}
else
{
enb = s3;
}
//1-2-3 and 3-2-1
if ((s2 > s1 && s2 < s3) || (s2 < s1 && s2 > s3))
{
ort = s2;
}
//2-1-3 and 2-3-1
else if ((s1 > s2 && s1 < s3) || (s1 < s2 && s1 > s3))
{
ort = s1;
}
else { ort = s3; }
bn = (enb * 0.60) + (ort * 0.40);
if (bn >= 60)
{
g++;
}
else
{
k++;
}
}
Console.Write("gecenler: {0}\n kalanlar : {1}", g, k);
Console.Read();