1 solutions
-
0
C++ :
#include <bits/stdc++.h> using namespace std; int main(){ int n,q,b,s,g,y,d; cin>>n; q = n / 1000; b = n / 100 % 10; s = n / 10 % 10; g = n % 10; y = g * 1000 + s * 100 + b * 10 + q; d = y - n; cout<<y<<"-"<<n<<"="<<d<<endl; }
Java :
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int a = x/1000; int b = x/100%10; int c = x/10%10; int d = x%10; int y = 1000*d+100*c+10*b+a; int z = y-x; System.out.println(y+"-"+x+"="+z); } }
- 1
Information
- ID
- 10502
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By