Перенос страниц
This commit is contained in:
parent
4d57446057
commit
4c954c9186
129 changed files with 14 additions and 15 deletions
|
@ -1,48 +0,0 @@
|
|||
module stats;
|
||||
|
||||
interface Stat
|
||||
{
|
||||
void accumulate(double x);
|
||||
void postprocess();
|
||||
double result();
|
||||
}
|
||||
|
||||
class Min : Stat
|
||||
{
|
||||
private double min = double.max;
|
||||
|
||||
void accumulate(double x)
|
||||
{
|
||||
if (x < min)
|
||||
{
|
||||
min = x;
|
||||
}
|
||||
}
|
||||
|
||||
void postprocess() {} // Ничего не делать
|
||||
|
||||
double result()
|
||||
{
|
||||
return min;
|
||||
}
|
||||
}
|
||||
|
||||
class Max : Stat
|
||||
{
|
||||
private double max = double.min_normal;
|
||||
|
||||
void accumulate(double x)
|
||||
{
|
||||
if (x > max)
|
||||
{
|
||||
max = x;
|
||||
}
|
||||
}
|
||||
|
||||
void postprocess() {} // Ничего не делать
|
||||
|
||||
double result()
|
||||
{
|
||||
return max;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue