/* p12.c */ /* Construct a solid color image of the specified color */ /* Input arguments */ /* width in pixels */ /* height in pixels */ /* red value */ /* green value */ /* blue value */ #include #include int main() { int width; int height; int count = 0; unsigned int red; unsigned int green; unsigned int blue; fscanf(stdin, "%d", &width); fscanf(stdin, "%d", &height); fscanf(stdin, "%d", &red); fscanf(stdin, "%d", &green); fscanf(stdin, "%d", &blue); fprintf(stdout, "P6\n"); fprintf(stdout, "%d %d 255\n", width, height); while (count < (width * height)) { fprintf(stdout, "%c%c%c", red, green, blue); count = count + 1; } return(0); }