Răspuns:
Sper să fie corect:
Explicație:
#include <iostream>
using namespace std;
unsigned int n, cif, c;
long long S;
long double ma;
int main()
{
cin >> n;
while(n)
{
cif = n % 10;
if(cif % 3 == 0)
{
S += cif;
++c;
}
n /= 10;
}
ma = (double)S / c;
cout << ma;
return 0;
}