försökt hitta extremer
This commit is contained in:
@ -23,12 +23,31 @@ namespace _2018_06
|
|||||||
}
|
}
|
||||||
|
|
||||||
int points = 0;
|
int points = 0;
|
||||||
foreach(Tuple<int,int> tp in koords)
|
int al = 999+999, bl = 0;
|
||||||
|
int a1=999, a2 = 999;
|
||||||
|
int b1 = 0, b2 = 0;
|
||||||
|
|
||||||
|
foreach (Tuple<int,int> tp in koords)
|
||||||
{
|
{
|
||||||
points++;
|
points++;
|
||||||
WriteLine($"point {points}, X: {tp.Item1} Y: {tp.Item2}");
|
WriteLine($"point {points}, X: {tp.Item1} Y: {tp.Item2}");
|
||||||
|
if (tp.Item1 + tp.Item2 < al)
|
||||||
|
{
|
||||||
|
a1 = tp.Item1;
|
||||||
|
a2 = tp.Item2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tp.Item1 + tp.Item2 > bl)
|
||||||
|
{
|
||||||
|
b1 = tp.Item1;
|
||||||
|
b2 = tp.Item2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WriteLine($"low value: {a1},{a2} high value: {b1},{b2}");
|
||||||
ReadKey();
|
ReadKey();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user