Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int funckija(int a, int b, char znak) {
- int answer = 0;
- if(znak == '+') {
- answer = a + b;
- }
- else if(znak == '-') {
- answer = a - b;
- }
- return answer;
- }
- int main() {
- int n, m;
- cin >> n >> m;
- cout << funckija(n, m, '+') << endl;
- cout << funckija(n, m, '-') << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement