题目
思路
水题
代码
#include <iostream>
#include <string>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#include<string.h>
#include<math.h>
using namespace std;
#define nmax 105
#define inf 999999
int red, green, blue;
string change(int num)
{
stringstream ss;
if (num == 10)
return "A";
else if (num == 11)
return "B";
else if (num == 12)
return "C";
else
{
ss << num;
return ss.str();
}
}
string change_color(int num)
{
string str;
int divisor = num /13;
int remainder = num % 13;
str = change(divisor) + change(remainder);
return str;
}
int main()
{
cin >> red >> green >> blue;
cout << "#" << change_color(red) << change_color(green) << change_color(blue);
return 0;
}