Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Nevermind ( 7 years ago )
#include <iostream> // input / output stream
#include <math.h>
using namespace std;
int main() {
// Çàäà÷à ¹4. Êàëüêóëÿòîð.
cout << "Please enter a_b, where's '_' mean '*','/','+' or'-':" << endl;
double a, b, result;
char c;
cin >> a >> c >> b;
if (c == '*') {
result = a*b;
cout << result << endl;
}
else if (c== '/') {
result = a/b;
cout << result << endl;
}
else if (c == '-'){
result = a - b;
cout << result << endl;
}
else if (c == '+') {
result = a + b;
cout << result << endl;
}
}
Revise this Paste