关于C的问题,求解答!

img


刚刚学习C,想输入数据,可是照着书本打根本没用,还会报错,各位亲可以帮忙看看吗
想达到的效果是:
输入一个正整数
依次逐行输出从正整数到一的各个数

%u改成%d试试
printf("%d",N)
或者直接改成这样

#include <stdio.h>
int main()
{
    int N;
    scanf("%u", &N);
    while (N > 0)
    {
        printf("%u",N);
        putchar('\n');
        N--;
    }
    return 0;
}



#include <stdio.h>
int main()
{
    int N;
    scanf("%u",&N);
    while (N>0) {
        printf("%d",N);
        putchar('\n');
        N--;
    }
    return 0;
}