#include <stdio.h>
//自分の攻撃力と相手の攻撃力を入力して
//与えるダメージと与えるクリティカルダメージをもらうdamege関数を作成しなさい
void damege(int attack, int defence, int& normal, int& critical)
{
normal = attack – defence;
critical = attack * 1.5 – defence;
}
int main()
{
int x;
int y;
damege(530000, 4, x, y);
printf(“通常ダメージ %dn”, x);
printf(“クリティカルダメージ%dn”, y);
return 0;
}
http://sealsoft.jp/ptr_and_ref.html