哪里错了吗
查看原帖
哪里错了吗
1247040
V_HAPPY666楼主2024/8/21 07:41
#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int n;
	cin>>n;
	int f=(n/100%10)*100+(n/10%10)*10+n%10;
    if(f==0)cout<<0;
    else
    {
        if(f<=500)cout<<f;
        else cout<<1000-f;
    }
	return 0;
}
2024/8/21 07:41
加载中...