互联网技术 / 互联网资讯 · 2023年11月25日

云计算开发:Python练习实例-输入3个整数

输入三个整数x,y,z,请把这三个数由小到大输出。

我们想办法把最小的数放到x上,先将x与y进行比较,如果x>y则将x与y的值进行交换,然后再用x与z进行比较,如果x>z则将x与z的值进行交换,这样能使x最小。

执行以上代码输出结果为:

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册