Add 2024/task12.cpp

This commit is contained in:
2024-12-20 17:41:52 +00:00
parent fead9fcbae
commit ab0ef4037c

23
2024/task12.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include <iostream>
using namespace std;
// "2561" => "1652+2561=4213"
int main ()
{
int a,b;
cin >> a;
int d1, d2, d3, d4;
d1 = a % 10;
d2 = a / 10 % 10;
d3 = a / 100 % 10;
d4 = a / 1000;
b = d1 * 1000 + d2 * 100 + d3 * 10 + d4;
cout << b << '+' << a << '=' << a+b;
return 0;
}