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
using namespace std; int main() { int poceten_broj, kraen_broj; cin >> poceten_broj >> kraen_broj; int a1, a2, a3, a4; a4 = poceten_broj % 10; a3 = (poceten_broj / 10) % 10; a2 = (poceten_broj / 100) % 10; a1 = poceten_broj / 1000; int b1, b2, b3, b4; b4 = kraen_broj % 10; b3 = (kraen_broj / 10) % 10; b2 = (kraen_broj / 100) % 10; b1 = kraen_broj / 1000; int rezultat = 0; rezultat += min(abs(a1 - b1), 10 - abs(a1 - b1)); rezultat += min(abs(a2 - b2), 10 - abs(a2 - b2)); rezultat += min(abs(a3 - b3), 10 - abs(a3 - b3)); rezultat += min(abs(a4 - b4), 10 - abs(a4 - b4)); cout << rezultat << 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)