题目描述

Write a complete C++ program with the two alternate functions specified below, each of which simply triples the variable count defined in main. Then compare and contrast the two approaches. These two functions are:
a) function tripleByValue that passes a copy of count by value, triples the copy and returns the new value and
b) function tripleByReference that passes count by reference via a reference parameter and triples the original value of count through its alias (i.e., the reference parameter).


输入格式


输出格式

Note the spaces in the output.


样例数据

输入

4

输出

Value of count before call to tripleByValue() is: 4
Value returned from tripleByValue() is: 12
Value of count (in main) after tripleCallByValue() is: 4
Value of count before call to tripleByReference() is: 4
Value of count (in main) after call to tripleByReference() is: 12

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解