关于html:前端主流布局系统进阶与实战一课搞定4大主流布局轻松实现各种精美页面

download:前端支流布局零碎进阶与实战,一课搞定4大支流布局,轻松实现各种精美页面

上面的都不重要
//四则运算

include “stdafx.h”

include

include<stdio.h>

using namespace std;
void add()
{

printf("输出要计算的加数(例如a b)\n");
int adda=0, addb=0,addc=0;
cin >> adda;
cin >> addb;
addc = adda+addb;
cout <<adda<<"加"<<addb<< "等于" << addc << endl;
 

}
void substraction()
{

printf("输出要计算的减数(例如a b)\n");
int suba = 0, subb = 0, subc = 0;
cin >> suba;
cin >> subb;
subc = suba-subb;
cout <<suba<<"减"<<subb<< "等于" << subc << endl;

}
void multiplication()
{

printf("输出要计算的乘数(例如a b)\n");
int mula = 0, mulb = 0, mulc = 0;
cin >> mula;
cin >> mulb;
mulc = mula*mulb;
cout <<mula<<"乘"<<mulb<< "等于" << mulc << endl;

}
void division()
{

printf("输出要计算的除数(例如a b)\n");
int dsa = 0, dsb = 0, dsc = 0,dsd=0;
cin >> dsa;
cin >> dsb;
dsc = dsa/dsb;
dsd = dsa%dsb;
cout <<dsa<<"除"<<dsb<< "等于" << dsc <<"余"<<dsd<<endl;

}
void operation()//运算函数
{

printf("输出数据抉择做那种运算\n");
printf("输出0抉择退出,1做加法,2做减法,3做乘法,4做除法(保留余数)\n");
 
int operatione = 0;
cin >> operatione;
cout << endl;
try
{
    if (operatione == 1)
    {
        //加法
        add();
    }
    else if (operatione == 2)
    {
        //减法
        substraction();
    }
    else if (operatione == 3)
    {
        //乘法
        multiplication();
    }
    else if (operatione == 4)
    {
        //出发
        division();
    }
    else if (operatione == 0)
    {
        exit(0);
    }
    else
    {
        throw 1;
    }
}
catch (int i)
{
    cout << "输出谬误" << endl;
}
operation();

}
int main()
{

printf("欢迎使用本计算器");
operation();
return 0;

}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理