Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <iomanip>
- #include <iostream>
- using namespace std;
- int izbacinule(int n)
- {
- int broj=n, nb(0),k(1), cifra;
- while (broj!=0)
- {
- cifra=broj%10;
- while (broj%10==0)
- broj/=10;
- cifra=broj%10;
- nb=cifra*k+nb;
- broj/=10;
- k*=10;
- }
- return nb;
- }
- int main()
- {
- int n;
- std::cout<<"Unesite prirodan broj: "<<std::endl;
- cin>>n;
- std::cout<<"Novi broj: "<<std::endl;
- int a=izbacinule(n);
- cout<<a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement