输入一个正整数n(1 <n≤10),再输入n 个整数,将最小值与第一个数交换,最大值与最后一个数交换.

2025-03-13 20:35:20
推荐回答(1个)
回答1:

是你的交换写错了,定义一个temp
temp = a;
a = b;
b = temp;