eolymp
bolt
Try our new interface for solving problems
Məsələlər

Sıfırları sürüşdür

dərc olunub 02.01.24 20:16:42

include<bits/stdc++.h>

using namespace std; int main(){ int n,m; cin>>n; m=n; int a[n],i; for(i=0; i<n; i++) cin>>a[i]; for(i=0; i<n; i++){ if(i>=m) cout<<"0 "; else{ if(a[i]!=0) cout<<a[i]<<" "; else n++;} } }