Untitled

mail@pastecode.io avatar
unknown
plain_text
17 days ago
343 B
1
Indexable
Never
#include <iostream>

struct Adder {
    int operator()(int a, int b) const {
        return a + b;
    }
};

int main() {
    int num1, num2;
    std::cout << "Enter two numbers: ";
    std::cin >> num1 >> num2;

    Adder add;
    int sum = add(num1, num2);

    std::cout << "Sum: " << sum << std::endl;

    return 0;
}
Leave a Comment