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
using namespace std; int main() { int M; cin >> M; int broj = 0; int najgolem_broj = -1; int cifra = 0; int ckorcinja = 0; int potrebni_ckorcinja[10]; potrebni_ckorcinja[0] = 6; potrebni_ckorcinja[1] = 3; potrebni_ckorcinja[2] = 5; potrebni_ckorcinja[3] = 5; potrebni_ckorcinja[4] = 4; potrebni_ckorcinja[5] = 5; potrebni_ckorcinja[6] = 5; potrebni_ckorcinja[7] = 3; potrebni_ckorcinja[8] = 7; potrebni_ckorcinja[9] = 5; for(int i = 1000; i <= 9999; i += 1) { broj = i; while(i > 0) { cifra = i % 10; i /= 10; ckorcinja += potrebni_ckorcinja[cifra]; } i = broj; if (ckorcinja == M) { najgolem_broj = i; } ckorcinja = 0; } cout << najgolem_broj << endl; return 0; }
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)