Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
int GDP(int a, int b){ while (a%b == 0) a = a/b; return a; } bool isHamming(int n){ n = GDP(n, 2); n = GDP(n, 3); n = GDP(n, 5); return (n == 1)? true : false; } int findNumber(int n){ int num = 1; int count = 1; while (n > count){ num++; if(isHamming(num)) count++; } return num; } int main(){ int n; while(scanf("%d", &n)){ if(n==0){ return 0; } printf("%d\n", findNumber(n)); } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)