2 条题解

  • 1
    @ 2025-9-7 15:18:08
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,c=999999;
    	cin>>a>>b;
    	for(int i=1;i<=9;i++)
    		for(int j=0;j<=9;j++)
    		{
    			if(i+j==a&&i>=j&&i-j==b)
    				if(i*10+j<c) c=i*10+j;
    			if(i+j==a&&j>i&&j-i==b)
    				if(i*10+j<c) c=i*10+j;
    		}
    	cout<<c;
        return 0;
    }
    

    信息

    ID
    111
    时间
    1000ms
    内存
    64MiB
    难度
    7
    标签
    递交数
    31
    已通过
    9
    上传者