请问我的指针传递有什么问题吗?
查看原帖
请问我的指针传递有什么问题吗?
971088
pgmli楼主2024/8/25 16:57
#include <bits/stdc++.h>
#define int long long
using namespace std;

int n;

void prefr(int* money)
{
	if(money >= 100) money -= 20;
	if(money >= 200) money -= 50;
	return ;
}

signed main()
{
	cin >> n;
	prefr(&n);
	cout << n;
	
	return 0;
}
2024/8/25 16:57
加载中...