Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- { int i,l,j;
- char str[20];
- gets(str);
- l=strlen(str);
- for(i=l-1;i>=0;i--)
- {
- if(str[i]=='1')
- {
- break;
- }}
- for(j=i-1;j>=0;j--)
- {
- if(str[j]=='1')
- str[j]='0';
- else
- str[j]='1';
- }
- printf("%s",str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement