逆序输出:输入一个正整数,将该正整数逆序输出。

#include <stdio.h>

void printDigit(int n) {
    printf("%d", n % 10);
    if (n > 10) {
        printDigit(n / 10);
    }
}

void main() {
    int n;
    scanf("%d", &n);
    printDigit(n);
}
发布了66 篇原创文章 · 获赞 1 · 访问量 924

猜你喜欢

转载自blog.csdn.net/qq_38490457/article/details/104576389
今日推荐