#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int mas[5];
for(int i = 0; i < 5; i++){
cout << "Input element[" << i << "] = "; cin >> mas[i];
while(mas[i] < 0){
}
cout << "Show massiv" << endl;
cout << mas[i] << " ";
cout << "\nReversed massiv without zero(0)" << endl;
for(int i = 4; i >= 0; i--){
if(mas[i] != 0){
cout << endl;
system("pause");
return 0;
#include <string>
string st;
cin>>st;
for(int i=0;i<n;++i)
if(s[i] == '0')
st=st.erase(i);
cout<<reverse(st)<<endl;
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int mas[5];
for(int i = 0; i < 5; i++){
cout << "Input element[" << i << "] = "; cin >> mas[i];
while(mas[i] < 0){
cout << "Input element[" << i << "] = "; cin >> mas[i];
}
}
cout << "Show massiv" << endl;
for(int i = 0; i < 5; i++){
cout << mas[i] << " ";
}
cout << "\nReversed massiv without zero(0)" << endl;
for(int i = 4; i >= 0; i--){
if(mas[i] != 0){
cout << mas[i] << " ";
}
}
cout << endl;
system("pause");
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
string st;
cin>>st;
for(int i=0;i<n;++i)
{
if(s[i] == '0')
{
st=st.erase(i);
}
cout<<reverse(st)<<endl;
system("pause");
return 0;
}