#include
#include
int main()
{
char color[10], resistance[10], tolerance[10];
int band1, band2, band3, band4, band5;
printf("请输入5个带电阻器颜色(空格分隔):");
scanf("%s %s %s", color, color+2, color+4);
if (strcmp(color,"black") == 0){ band1=0; }
else if (strcmp(color,"brown") == 0){ band1=1; }
else if (strcmp(color,"red") == 0){ band1=2; }
else if (strcmp(color,"orange") == 0){ band1=3; }
else if (strcmp(color,"yellow") == 0){ band1=4; }
else if (strcmp(color,"green") == 0){ band1=5; }
else if (strcmp(color,"blue") == 0){ band1=6; }
else if (strcmp(color,"violet") == 0){ band1=7; }
else if (strcmp(color,"gray") == 0){ band1=8; }
else if (strcmp(color,"white") == 0){ band1=9; }
if (strcmp(color+2,"black") == 0){ band2=0; }
else if (strcmp(color+2,"brown") == 0){ band2=1; }
else if (strcmp(color+2,"red") == 0){ band2=2; }
else if (strcmp(color+2,"orange") == 0){ band2=3; }
else if (strcmp(color+2,"yellow") == 0){ band2=4; }
else if (strcmp(color+2,"green") == 0){ band2=5; }
else if (strcmp(color+2,"blue") == 0){ band2=6; }
else if (strcmp(color+2,"violet") == 0){ band2=7; }
else if (strcmp(color+2,"gray