我需要c++的编程实际例子

来源:百度知道 编辑:UC知道 时间:2024/07/06 17:42:38
我需要一个c++的编程实例 就是详细的程序内容的那种 谁能帮忙啊
我多赠送分
我在个垃圾的三流大学混里 现在快毕业了 啥求也没有学会 学校还非得让做毕业设计```我晕死了 对了 还有毕业论文 ``
我不会弄啊 我在学校白混了 2年半了 哎
啥也不说了 谁能给弄个详细的c++的编程实例 有点实用价值的最好了
如果在带点详细的分析 就更好了 `

送你个计算器小程序送去当编程实例
#include <iostream>
#include <cstdio>

using namespace std;
class jishu
{
public:
jishu();

double a(char );
void b(int,int );

private:

double c;
double e;
char f;
};
jishu::jishu()
{
cout<<"计算器小程序加(+)、减(-)、乘(*)、除(/)"<<endl;
}
double jishu::a(char k)
{
switch (k)
{
case '*':
return c*e;
break;
case '/':
return c/e;
break;
case '+':
return c+e;
break;
case '-':
return c-e;
break;

default:
cout<<"输入错误,请重新输入"<<endl;
while(getchar() != '\n'); //加了1个C格式的清除缓冲区语句

}
}

void jishu::b(int h,int w)
{
c=h;
e=w;

}
void main()
{

jishu ffff;
while(int k=1)
{