#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
string x;
string a = "black";
string b = "red";
string c = "white";
int e = 0, f =0, g = 0; //e = black; f = red; g = white;
std::string yes_or_no;
while(true)
{
cout << "input car color :";
cin >> x;
if (x == a)
{
++e;
cout << "continue input car color(y/n)?";
std::cin >> yes_or_no;
if(yes_or_no == "n")
{
break;
}
}
else if (x == b)
{
++f;
cout << "continue input car color?(y/n)";
std::cin>>yes_or_no;
if(yes_or_no == "n")
{
break;
}
}
else if (x == c)
{
++g;
cout << "continue input car color?(y/n)" ;
std::cin>>yes_or_no;
if(yes_or_no == "n")
{
break;
}
}
}
cout << "detail car color" << endl;
std::cout<<std::setw(11) << left <<"black: "<<e<<std::endl;
std::cout<<std::setw(11) << left <<"red: "<< f<<std::endl;
std::cout<<std::setw(11) << left <<"white: "<<g<<std::endl;
return 0;
}