要输入无符号整数,请使用%u格式说明符。 例如,

#include <stdio.h>

int main(void)
{
   unsigned num;
   scanf("%u", &num);

   printf("%u", num);

   return 0;
}