Skip to content

Instantly share code, notes, and snippets.

@Lulzx
Created April 26, 2019 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lulzx/0a0955f6e70ba324332514bf026355fa to your computer and use it in GitHub Desktop.
Save Lulzx/0a0955f6e70ba324332514bf026355fa to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
int i;
scanf("%d", &i);
while(i != 1){
printf("%d → ", i);
if(!(i % 2)){
i /= 2;
}
else if(i % 2){
i *= 3;
i += 1;
}
}
printf("%d\n", i);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment