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
#include
#include
#include
#include
using namespace std; int sledna_vrednost(int broj) { int tmp = broj; int sum = 0; while(tmp > 0) { sum += tmp % 10; tmp /= 10; } return broj + sum; } int main() { int potok; cin >> potok; int potok1 = 1; int potok3 = 3; int potok9 = 9; while(potok != potok1 and potok != potok3 and potok != potok9) { while(potok1 < potok) { potok1 = sledna_vrednost(potok1); } while(potok3 < potok) { potok3 = sledna_vrednost(potok3); } while(potok9 < potok) { potok9 = sledna_vrednost(potok9); } if(potok != potok1 and potok != potok3 and potok != potok9) { potok = sledna_vrednost(potok); } } if(potok == potok1) { cout << 1 << " "; } else if(potok == potok3) { cout << 3 << " "; } else { cout << 9 << " "; } cout << potok << 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)