Advertisement
Alx09

Borz lab

Jun 1st, 2020
920
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. #include <stdlib.h>
  3.  
  4. void F(int n) {
  5.     if (n) {
  6.    
  7.         printf("%d ",n- (n &(n - 1)));
  8.         F((n &(n - 1)));
  9.     }
  10. }
  11.  
  12.  
  13.  
  14. int main() {
  15.     int n;
  16.     printf("n= "); scanf("%d", &n);
  17.     F(n);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement