How to line up cout statement?

I know this should be easy but can anyone help me line up these cout statements so they look good on the output scree,Any help would be appreciated. Thanks :)

1
2
3
4
5
6
7
8
9
10
11
12
myfile << "Matching Numbers       Winning Tickets   	     Draw # 2970 " << endl;
		myfile << "5 + MEGA                << mega_five <<	                0" << endl;
		myfile << "5                       << five <<	                       "1" << endl; //<-- this is the number of tickets that have five wining numbers
		myfile << "4 + MEGA            << mega_four <<	               "6" << endl; //<-- this is the number of tickets that have 4 wining numbers  and the wininnig mega number
		myfile << "4                   << four <<                        "327" << endl;
		myfile << "3 + MEGA            << mega_three <<	             "523" << endl;
		myfile << "3                   << three <<                     "14518" << endl;
		myfile << "2 + MEGA            << mega_two <<	            "6373" << endl;
		myfile << "1 + MEGA                << mega_one <<	           "31835" << endl;
		myfile << "MEGA                    << mega <<                      "49027" << endl;
		myfile << "0                       << zero << endl;
		myfile << "Winning tickets total   << total <<                    "102610" << endl;
you can try using \t for example:

1
2
3
4
5

my file << "Matching Numbers \t \t Winning Tickets \t \t Draw #2970" << endl;

myfile << "5 + MEGA \t \t << mega_five << "\t \t 0" << endl;
 


something like that might output a little easier, just adjust the amount of "\t"'s. good luck :)
Last edited on
Topic archived. No new replies allowed.