Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int Fib(int i)
- {
- if (i == 0 || i == 1) return 1;
- return Fib(i - 1) + Fib(i - 2);
- }
- int main()
- {
- /*int n;
- cin >> n;
- for (int i = 0; i < n; i++)
- {
- cout << Fib(i) << " ";
- }
- */
- double a, b, result;
- char c;
- cin >> a >> c >> b;
- switch (c)
- {
- case '+': result = a + b; break;
- case '-': result = a - b; break;
- case '*': result = a * b; break;
- case '/': result = a / b; break;
- default:break;
- }
- cout << a << c << b << "=" << result << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement