问题遇到的现象和发生背景
前辈们,出现了error C2064
用代码块功能插入代码,请勿粘贴截图
#include <iostream>
#include <string>
using namespace std;
int main() {
int R;
int G;
int B;
int b;
printf("Please enter the corresponding values for R, G, B");
cin >> R >> G >> B;
int c = min(R, G, B);
int r = R - c;
int g = G - c;
int b = B - c;
if (r = 0)
{
int H = 240 - 120 * g/(g+b);
int L = (R + G + B) / 3;
int a;
a = max(R, G, B);
int S = (a - c) / (a + c);
cout << H << L << S << endl;
}
if (g = 0)
{
int H = 360 - 120 * b/(b+r);
int L = (R + G + B) / 3;
int a;
a = max(R, G, B);
int S = (a - c) / (a + c);
cout << H << L << S << endl;
}
if (b = 0)
{
int H = 120 - 120*r / (r + g);
int L = (R + G + B) / 3;
int a;
a = max(R, G, B);
int S = (a - c) / (a + c);
cout << H << L << S << endl;
}
system("pause");
}
运行结果及报错内容
error C2064: 项不会计算为接受 2 个参数的函数
我的解答思路和尝试过的方法
查了一下说这个问题是定义的函数名与定义的变量参数重名了,但不知道是哪个
我想要达到的结果
可以帮我解答一下吗,谢谢!