题解 | 整数的十位

整数的十位

https://www.nowcoder.com/practice/031db23916904f4fad72198fe491b47b

#include <stdio.h>

int main() {
    int a;
    while (scanf("%d", &a) != EOF) { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        if (a<10){
            printf("%d",0);
        }
        else {
        int b = a / 10;
        int c = b %10;
        printf("%d",c);        
        }
    }
    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务