Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
srednie
#include <iostream> using namespace std; int tab[1111]; int x,i,t; float s,y; int main() { while(x!=-1) { cin>>x; if(x!=0 && x!=1 && x!=-1) { i++; s=s+x; tab[i]=x; } if(x==1) { y=s/i; printf("%0.2f\n", y); } else if(x==0) { for(t=1;t<=i;t++) { cout<<tab[t]<<" "; } cout<<endl; } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Count edges in a graph
Rectangle overlap
cotton farm 0.0.1.0
First and last Occurence of an Element
Top view of a Binary tree
Conjuntos - Comparar cantidad de elementos únicos en 2 vectores
NumType
Making pyramid using nested loop 2/2
Shortest path in binary tree
Scemo
Please log in to post a comment.