各位大虾,请帮忙看看下面的程序错 在哪
#include <stdio.h>
#include <string.h>
#define FALSE 0
#define TRUE 1
#define LEN 30
enum spectrum {red, orange, yellow, green, blue, violet};
const char * colors[] = {"red", "orange", "yellow",
"green", "blue", "violet"
};
int main (void)
{
char choice[LEN];
enum spectrum color;
int che;
puts ("Enter a color (empty line to quit): ");
while (gets (choice) != NULL && choice[0] != '\0')
{
for (color = red; color <= violet; color ++)
{
if (strcmp (choice,colors[color]) == 0)
{
che = TRUE;
break;
}
}
if (che);
switch (color)
{
case red : puts ("Roses are red.");
break;
case orange : puts ("Poppies are orange.");
break;
case yellow : puts ("Sunflowers are yellow.");
break;
case green : puts ("Grass is green.");
break;
case blue : puts ("Bluebells are blue.");
break;
case violet : puts ("Violet are violet.");
break;
}
else
printf ("I don't know about the color %s.\n", choice);
che = FALSE;
puts ("Next color, please(empty line to quit): ");
}
puts ("Goodbye!");
return o}