#include <iostream>
using namespace std;
int addition (int a, int b)
{ return (a+b); }
int subtraction (int a, int b)
{ return (a-b); }
int operation (int x, int y, int (*functocall)(int,int))
{
int g;
g = (*functocall)(x,y);
return (g);
}
int main ()
{
int m,n;
// int (*minus)(int,int) = subtraction;
m = operation (7, 5, addition);
// n = operation (20, m, minus);
n = operation (20, m, subtraction);
cout <<n;
return 0;
}
c++基础(14)
最新推荐文章于 2024-08-21 18:16:36 发布