mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-27 08:26:20 +00:00
23 lines
302 B
C
23 lines
302 B
C
|
// int max=0,min=9999999,total=0;
|
||
|
|
||
|
int fun() {
|
||
|
int x;
|
||
|
static int cnt = 0;
|
||
|
|
||
|
while (scanf("%d", &x) != EOF && x != -1) {
|
||
|
total += x;
|
||
|
|
||
|
if (x > max) {
|
||
|
max = x;
|
||
|
}
|
||
|
|
||
|
if (x < min) {
|
||
|
min = x;
|
||
|
}
|
||
|
|
||
|
cnt++;
|
||
|
}
|
||
|
|
||
|
return cnt;
|
||
|
}
|