code
#include <iostream>
using namespace std;
//당연하게도 Minus의 x,y와 Plus의 x,y는 다른 값이다. 레퍼런스 변수(지역변수)이기 때문이다.
void Minus(const int x, const int y)
{
cout << "x - y = " << x - y << endl;
}
int Plus(const int x, const int y)
{
return x + y;
}
//개인적으로 main()함수가 깔끔해야 한다고 생각하기 때문에 되도록이면 Minus의 방식을 취하자!
//Plus 방식에 만약 반복문이라도 들어가게 된다면 반복할때마다 함수가 실행되기 때문에 컴파일 시간이 더오래걸린다.
int main()
{
Minus(10, 5);
cout << "x + y = " << Plus(2, 6) << endl;
return 0;
}