#include #include using namespace std; int main() { int n,a,b,temp; cin>>n; a=n/10; b=n%10; temp=a; a=b; b=temp; cout<<a<<b; return 0;
}
#include using namespace std; int main(){ int a,b,temp; cin>>a>>b>>temp; temp=a; a=b; b=temp; cout<<10*a+b; return 0; }
````language`
#include <iostream> int main() { int n; std::cin >> n; // 提取十位和个位数字 int tens = (n / 10) % 10; int ones = n % 10; // 计算交换后的数字 int swapped = ones * 10 + tens; // 输出结果 std::cout << swapped << std::endl; return 0; }
注册一个 9minute 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 9minute 通用账户