题解 | #简单运算#

简单运算

https://www.nowcoder.com/practice/23c9b22d40fa4d7698a1306fb0c9f975

#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
    int a,b;
    // write your code here......
    scanf("%d %d",&a,&b);
    int he,cha,ji,shan,mo;
    he=a+b;ji=a*b;
    if(a>b)
    {cha=a-b;
    shan=a/b;
    mo=a%b;}
    else
    {cha=b-a;
    shan=b/a;
    mo=b%a;}
    printf("%d %d %d %d %d",he,cha,ji,shan,mo);
    return 0;
}

全部评论

相关推荐

03-01 19:30
已编辑
南京大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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