Add 2024/task9.cpp
This commit is contained in:
21
2024/task9.cpp
Normal file
21
2024/task9.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
// "256" => "625-256=369"
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
int a,b;
|
||||||
|
|
||||||
|
cin >> a, b;
|
||||||
|
|
||||||
|
int d1, d2, d3;
|
||||||
|
d1 = a % 10;
|
||||||
|
d2 = a / 10 % 10;
|
||||||
|
d3 = a / 100 % 10;
|
||||||
|
|
||||||
|
b = d1 * 100 + d3 * 10 + d2;
|
||||||
|
|
||||||
|
cout << b << '-' << a << '=' << b-a;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user