Dim a As Integer, b As Integer, c As Integer Dim d As Integer, e As String, f As String Private Sub

2025-01-05 14:12:07
推荐回答(1个)
回答1:

using System;

class Test1
{
static void Main(String[]args){
Console.WriteLine("请输入一个给定的正整数");
int a=Convert.ToInt32(Console.ReadLine());

int a1=(a%10)*10+a/10;//这里取a的对调数

//从10到99这个范围内查找
for(int i=11;i<100;i++){
if(a==i) continue;//去掉自身
int i1=(i%10)*10+i/10;//取i的对调数
if(a+i==a1+i1){
Console.WriteLine("{0}+{1}={2}+{3}",a,i,a1,i1);
}
}
}
}