Add 2024/task8.cpp

This commit is contained in:
2024-12-20 17:31:29 +00:00
parent aceb506674
commit 98e130fa48

21
2024/task8.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include <iostream>
using namespace std;
// "256" => "256+562=818"
int main ()
{
int a,b;
cin >> a, b;
int d1, d2, d3;
d1 = a % 10;
d2 = a / 10 % 10;
d3 = a / 100 % 10;
b = d2 * 100 + d1 * 10 + d3;
cout << a << '+' << b << '=' << a+b;
return 0;
}