top1编程
← 返回题目
题解

【入门】四位数的差

1 条题解

  • 0
    @ 2026-7-28 22:09:47
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
       int x,a,b,c,d,v;
       cin>>x;
        a=x/1000;
        b=x/100%10;
        c=x/10%10;
        d=x%10;
        v=a+b*10+c*100+d*1000;
        cout<<x-v;
        }
    
    • 1