#include <iostream>
#include <vector>
using namespace std;
int am_dig(int k){
int res = 0;
while(k > 0){
res++;
k /= 10;
}
return res;
}
double average(vector<double> a){
double sum = 0;
for(auto i: a)
sum += i;
return sum/a.size();
}
int main() {
vector<double> a;
double x = 1;
while(x != 0){
cin >> x;
if(am_dig(x) == 3)
a.push_back(x);
}
if(a.size() == 0)
cout << "NO";
else
cout << average(a);
}
CLS
FOR i = 1 TO 2
PRINT i; ":";
INPUT a, b, c, d
s = a + b + c + d
IF s >= 17 THEN
PRINT "Postupil"
ELSE
PRINT "Ne postupil"
END IF
NEXT i
Пример
1 :? 5,4,3,4
Ne postupil
2 :? 4,5,4,5
Postupil