以下是使用迭代方式逆序输出3个数的C语言代码:

#include <stdio.h>

int main() {
    int nums[3] = {1, 2, 3}; // 三个数的数组
    int i;
    for (i = 2; i >= 0; i--) { // 从最后一个数开始循环输出
        printf('%d ', nums[i]);
    }
    return 0;
}

输出结果为:3 2 1


原文地址: https://www.cveoy.top/t/topic/nfl6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录