上次写了一个中文版的计算器,而翻译了以下以后,作者再写个英文的吧(文章特别水有木有)
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b;
char c;
cout<<"QWQ氏计算器English(v1.1.1)"<<endl;
cout<<"Only single operation is supported. If you want to continue the operation, you can only write down the result and run it again"<<endl;
cout<<"Please press any key to continue...";
getchar();
system("cls");
cout<<"Please enter two numbers:"<<endl;
cin>>a>>b;
cout<<endl<<"Please enter an operator (only + plus -minus * multiply / divide is supported):"<<endl;
cin>>c;
if(c=='+')
cout<<a+b;
if(c=='-')
cout<<a-b;
if(c=='*')
cout<<a*b;
if(c=='/')
{
cout<<a/b<<endl;
cout<<"A division sign has been detected. When the result is an infinite decimal, 6 decimal places are reserved";
}
return 0;
}
好了,此地无银三百两,大家散了吧,我是nameQWQ_CSDN,我们下次再相逢!
(特水)
小弟告辞。 ?
|