#include<iostream> using namespace std; int main() { int x,s,n; float m; s=0; n=0; cout<<"x="; cin>>x; while(x!=0) { s=s+x; n++; cout<<"x="; cin>>x; } m=(float)s/n; cout<<m; }