#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream oFile; oFile.open("test.csv",ios::out|ios::trunc); oFile<<"属性1"<<","<<"属性2"<<","<<"结果1"<<","<<"结果2"<<endl; oFile<<"010101"<<","<<"1 2 3"<<","<<"32.2 112.3;23.12 23.22;23.14 23.45"<<","<<"1"<<endl; oFile.close(); }