Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- using namespace std;
- int main()
- {
- int Xcord, Ycord, Xdivpt, Ydivpt, repeat;
- ifstream infile;
- ofstream outfile;
- infile.open("Infile3.txt");
- outfile.open("Outfile3.txt");
- infile >> Xdivpt >> Ydivpt;
- outfile << "My Name \n \n";
- outfile << "This division point is " << Xdivpt << ',' << Ydivpt << " \n";
- while(infile)
- {
- infile >> Xcord >> Ycord;
- if (Xcord == Xdivpt && Ycord == Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Division Point \n";
- }
- else if (Xcord == Xdivpt && Ycord > Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Between Kiowa and Tepee \n";
- }
- else if (Xcord > Xdivpt && Ycord == Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Between Comanche and Kiowa \n";
- }
- else if (Xcord == Xdivpt && Ycord < Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Between Comanche and Nocona \n";
- }
- else if (Xcord < Xdivpt && Ycord == Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Between Nocona and Tepee \n";
- }
- else if (Xcord > Xdivpt && Ycord > Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Kiowa \n";
- }
- else if (Xcord > Xdivpt && Ycord < Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Comanche \n";
- }
- else if (Xcord < Xdivpt && Ycord < Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Nocona \n";
- }
- else if (Xcord < Xdivpt && Ycord > Ydivpt)
- {
- outfile << setw(6) << Xcord << setw(8) << Ycord << setw(14)
- << " Tepee \n";
- }
- }
- infile.close();
- outfile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement