28 lines
365 B
C++
28 lines
365 B
C++
#include <iostream>
|
|
#include <cstring>
|
|
#include <cstdlib>
|
|
|
|
using namespace std;
|
|
|
|
class Color
|
|
{
|
|
private:
|
|
int r, g, b;
|
|
|
|
public:
|
|
explicit Color(int r, int g = 0, int b = 0) : r(r), g(g), b(b)
|
|
{
|
|
}
|
|
void show()
|
|
{
|
|
cout << r << "," << g << "," << b << endl;
|
|
}
|
|
};
|
|
|
|
int main()
|
|
{
|
|
Color c = Color(2, 3, 4);
|
|
c.show();
|
|
return 0;
|
|
}
|