Vladislav_Bezruk

Some task

Nov 12th, 2020 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. char a,b = '0';
  4.  
  5. int main()   {
  6.        
  7.     while (scanf("%c",&a) == 1 and a == '0' or a == '1') {     
  8.     if (a == b)
  9.     printf("0");
  10.     else
  11.     printf("1");       
  12.     b = a; 
  13.     }
  14.            
  15.     return 0;
  16. }
Add Comment
Please, Sign In to add comment