题解 | 判断两个数的大小关系

判断两个数的大小关系

https://www.nowcoder.com/practice/f05358b9e8164b27871c87d3097f4dab

#include <stdio.h>

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

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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