/2 *3+1

Run Settings
LanguageC
Language Version
Run Command
#define _CRT_SECURE_NO_WARNINGS #include <ctype.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { bool f = true; int a = 81; scanf("%d", &a); while (a != 1) { printf(f ? "%d" : "-%d", a); if (a % 2 == 0) { a /= 2; } else { a = a * 3 + 1; } f = false; } printf("-%d\n", a); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines