Created
August 27, 2020 16:22
-
-
Save onokatio/4c297326faf508e0a27f8056cc28a1b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int calc(int i,int j,int k){ | |
return pow(2,i) * pow(3,j) * pow(5,k); | |
} | |
int main(void){ | |
int count = 0; | |
int amari; | |
int multiply = 1; | |
int i,j,k; | |
while(count < 100){ | |
i=j=k=0; | |
int n = multiply; | |
while(n % 2 == 0 && n >= 2){ | |
i++; | |
n /= 2; | |
} | |
while(n % 3 == 0 && n >= 3){ | |
j++; | |
n /= 3; | |
} | |
while(n % 5 == 0 && n >= 5){ | |
k++; | |
n /= 5; | |
} | |
if(n == 1){ | |
printf("%d = %d %d %d\n",30 * multiply,i,j,k); | |
count++; | |
} | |
multiply++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment