题解 | 简单运算

#include <iostream>
using namespace std;
template<typename  t>
void sum(t a,t b)
{
    if(a>b){
      printf("%d ",a+b);
    printf("%d ",a-b);
    printf("%d ",a*b);
    printf("%d ",a/b);
    printf("%d",a%b);
    }
    else
    {
     printf("%d ",a+b);
    printf("%d ",b-a);
    printf("%d ",a*b);
    printf("%d ",b/a);
    printf("%d",b%a);
    }
    
}
int main() {

    // write your code here......
    int a,b;
    scanf("%d\n %d\n",&a,&b);
    sum(a,b);

    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务