将书上对应的代码抄写了一遍。
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int nx = 200;
int ny = 100;
ofstream outfile( "mytest.txt", ios_base::out);
outfile << "P3\n" << nx << " " << ny << "\n255\n";
std::cout << "P3\n" << nx << " " << ny << "\n255\n";
for (int j = ny-1; j >= 0; j--)
{
for (