Advertisement
pyroan

Collatz Sequence Calculator (134 Bytes)

Oct 12th, 2017
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.13 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){int t,i;for(;;){scanf("%d",&t);i=0;for(;t>1;t=!(t&1)?t>>1:t*3+1){printf("%d\n",t);}printf("%d\n\n",t);}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement