-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexternal.c
executable file
·76 lines (58 loc) · 1.15 KB
/
external.c
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
72
73
74
75
76
#include<stdio.h>
#include<stdlib.h>
void check_flag();
void printCounter();
void counterAdd();
void updateNumberator();
void updateDenominator();
int counter = 0;
int numberator = 0;
int denominator = 0;
int maxResult = 999;
int minResult = -1;
int localMax = 0;
int localMin = 0;
void printCounter(){
printf("counter = %d\n", counter);
}
void counterAdd()
{
counter = counter + 1;
}
void printMaxResult(){
printf("max result = %f\n", maxResult);
}
void printMinResult(){
printf("min result = %f\n", minResult);
}
void resetLocalResult(){
localMax = 0;
localMin = 0;
}
void updateLocalMinResult(){
localMin += 1;
}
void updateLocalMaxResult(){
localMax += 1;
}
void updateGlobalMinResult(){
if(localMin<minResult){
minResult = localMin;
}
}
void updateGlobalMaxResult(){
if(localMax<maxResult){
maxResult = localMax;
}
}
void printResult(){
printf("counter = %f\n", numberator/denominator);
}
void updateNumberator()
{
numberator = numberator + 1;
}
void updateDenominator()
{
denominator = denominator + 1;
}