c++ excel格式的写入
// excel格式的写入
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ofstream oFile;
oFile.open("RGB.csv", ios::out | ios::trunc);
oFile << "X" << "," << "Y" << "," << "R" << "," << "G" << "," << "B" << endl; // endl 换行
oFile << "9" << "," << "8" << "," << "32" << "," << "21"<< "," << "96" << endl; // endl 换行
oFile.close();
cout << "R " << ", G " << ", B " << endl;
printf(" end! \n");
return 0;
}