prime div

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) { int Primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}; bool f = true; int i, n, e; scanf("%d", &n); for (i = 0; i < sizeof(Primes) && n > 1; ++i) { for (e = 0; n % Primes[i] == 0; n /= Primes[i]) { e++; } printf(f ? "%d" : ", %d", e); f = false; } printf("\n"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines