#include <QtCore/QCoreApplication>
#include<fstream>
#include<iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
char aa[4][50];
// memcpy(aa,0,200);
int TeachOrder,order;
ifstream infile;
infile.open("F:\\STUDY\\boost\\GLroboop\\trajectory\\f2.dat",ios::in);
while(!infile.eof())
{
order=1;
infile.getline(aa[0],100);
cout<<aa[0]<<endl;
if(!infile.eof()){
infile.getline(aa[1],100);
cout<<aa[1]<<endl; }
else {
order=2;
break;
}
if(!infile.eof()){
infile.getline(aa[2],100);
cout<<aa[2]<<endl; }
else {
order=3;
break;
}
if(!infile.eof()){
infile.getline(aa[3],100);
cout<<aa[3]<<endl; }
else {
order=0;
break;
}
}
cout<<order<<endl;
// cout<<aa[order]<<endl;
TeachOrder=atoi(aa[order]);
// cout<<max;
ofstream outfile("F:\\STUDY\\boost\\GLroboop\\trajectory\\f2.dat", ios::app);
outfile <<(TeachOrder+1)<< endl;
outfile<<1.1<<" "<<2.1<<" "<<3.1<<" "<<4.1<<" "<<5.1<<" "<<6.1<<endl;
cout <<(TeachOrder+1)<< endl;
cout<<1.1<<" "<<2.1<<" "<<3.1<<" "<<4.1<<" "<<5.1<<" "<<6.1<<endl;
outfile.close();
// cout<<bb[0]+2<<endl;
// for(i=0;i<22;i++)
// {
// infile>>aa[i];
// cout<<aa[i]<<endl;
// }
// infile.seekg(-50,ios::end);
// for(int j=0;j<18;j++)
// {
// infile>>bb[j];
// cout<<bb[j]<<endl;
// }
// infile>>bb[0];
// ofstream outfile("F:\\STUDY\\boost\\GLroboop\\trajectory\\f2.dat", ios::app);
// outfile <<bb[0]+1<< endl;
// outfile<<1.1<<" "<<2.1<<" "<<3.1<<" "<<4.1<<" "<<5.1<<" "<<6.1<<endl;
// cout<<bb[0]+2<<endl;
return a.exec();
}
int main2(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
float aa[27],bb[27];
char mm[50];
string kk;
int max,i,order;
ifstream infile;
infile.open("F:\\STUDY\\boost\\GLroboop\\trajectory\\f3.dat",ios::end);
// infile>>mm;
// cout<<mm<<endl;
// for(i=1;mm!='w';i++)
// {
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
infile.getline(mm,20);
cout<<mm<<endl;
if(mm==0)
cout<<"dddd";
// }
ofstream outfile("F:\\STUDY\\boost\\GLroboop\\trajectory\\f2.dat", ios::app);
// outfile <<bb[0]+1<< endl;
outfile<<1.1<<" "<<2.1<<" "<<3.1<<" "<<4.1<<" "<<5.1<<" "<<6.1<<endl;
infile.close();
return a.exec();
}