ZadatakS6.

#include <iostream>

using namespace std;

int main()
{
int i,j,d;
string s;
cin>>s;
d=s.size();
for(i=d-1;i>=0;i–)
while(s[i]==’0′){
if(s[i-1]!=’0′)
cout<<s[i-1]<<endl;
break;
}
return 0;
}

Advertisements