快捷导航

顺序结构设计

编写程序,输入2个整数,求这两个整数的和、差、积、商,输出商要求有2位小数。

写出你编写的程序

附上你运行程序后,输入的数据和输出结果

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

#include
int main()
{
        int a,b;
        scanf("%d%d",&a,&b);
        printf("a+b=%d\n",a+b);
        printf("a-b=%d\n",a-b);
        printf("a*b=%d\n",a*b);
        printf("a/b=%.2lf\n",(double)a/b);
        return 0;
}
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP