Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main ()
- {
- int v[1000],n,i,x=0,inv=0;
- cout<<"n=";cin>>n;
- while (n)
- {
- inv=inv*10+n%10;
- n/=10;
- }
- while (inv)
- {
- v[x]=inv%10;
- x++;
- inv/=10;
- }
- cout<<v[0];
- for (i=1;i<x;i++)
- {
- cout<<abs(v[i-1]-v[i]);
- cout<<v[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement