文本格式1:
#编号 x y z(以空格隔开)
00000 41 18467 6334
00001 26500 19169 15724
00002 11478 29358 26962
00003 24464 5705 28145
00004 23281 16827 9961
00005 491 2995 11942
00006 4827 5436 32391
00007 14604 3902 153
00008 292 12382 17421
00009 18716 19718 19895
####################################
文本格式2:
#id0 x0 y0 id1 x1 y1 id2 x2 y2 (以空格隔开)
0 18467 41 1 26500 6334 2 15724 19169
1 29358 11478 2 24464 26962 3 28145 5705
2 16827 23281 3 491 9961 4 11942 2995
3 5436 4827 4 14604 32391 5 153 3902
4 12382 292 5 18716 17421 6 19895 19718
5 21726 5447 6 11538 14771 7 19912 1869
6 26299 25667 7 9894 17035 8 23811 28703
7 30333 31322 8 4664 17673 9 7711 15141
8 6868 28253 9 27644 25547 10 32757 32662
9 12859 20037 10 9741 8723 11 778 27529
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<fstream> //iftsream, ofstream
#include<sstream> //streamstring
#include<iomanip> //setw, setfill
#include<ctime> //rand
#include<vector>
using namespace std;
class mPoint
{
public:
mPoint( int id, int x, int y) :m_id(id), m_x(x), m_y(y) {
}
public:
int m_id;
int m_x;
int m_y;
};
void WriteTxt_cpp(string txt_path); //c++风格写入,文本格式1
void ReadTxt_cpp(string txt_path); //c++风格读取,文本格式1
void WriteTxt_cpp_2(string txt_path); //c++风格写入,文本格式2
void ReadTxt_cpp_2(string txt_path); //c++风格读取,文本格式2
void WriteTxt_c(string txt_path); //c风格写入,文本格式1
void ReadTxt_c(string txt_path); //c风格读取,文本格式1
int main()
{
string txt_path = "./xyz.txt";
/*WriteTxt_cpp(txt_path);
ReadTxt_cpp(txt_path);*/
WriteTxt_