Advertisement
Alx09

Untitled

May 4th, 2020
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int s1[100], s2[100], x,vf1, vf2;
  5. void Punctul_1() {
  6. scanf("%d", &x);
  7. while (x) {
  8. s1[++vf1] = x % 8;
  9. x /= 8;
  10. }
  11.  
  12. }
  13. void Punctul_2() {
  14. int i;
  15. for (i = vf1; i ; i--)
  16. if ((s1[i] & (s1[i] - 1)) != 0)
  17. s2[++vf2] = s1[i];
  18. }
  19. void Punctul_3() {
  20. int i;
  21. for (i = vf2; i; i--)
  22. if ((s2[i] & 1 << 0) && (s2[i] & 1 << 2))
  23. printf("%d\n", s2[i]);
  24.  
  25.  
  26. }
  27.  
  28. int main() {
  29. Punctul_1();
  30. Punctul_2();
  31. Punctul_3();
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement