- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
public static unsafe void Random1()
{
int var = 0;
int* ptr = &var;
while (Console.ReadLine() != "Stop") Console.WriteLine(*ptr--);
}
public static unsafe void Random2()
{
int var = 0;
int* ptr = &var;
long x = 0;
while (Console.ReadLine() != "Stop")
{
for (int i = 0; i < 10; i++) x += *ptr++;
Console.WriteLine($"Random = {x} Random(0..1000) = {Math.Abs(x) % 5}");
}
}
guest 08.10.2016 22:49 # −1
guestinho 08.10.2016 23:22 # +1