1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void print_head(string name, string a, string b, string c, string d, string e, string f)
{
std::cout << std::setw(20) << std::left << name << std::right
<< std::setw(3) << a
<< std::setw(3) << b
<< std::setw(3) << c
<< std::setw(5) << d
<< std::setw(5) << e
<< std::setw(5) << f
<< "\n\n";
}
void print_detail(string name, int a, int b, int c, int d, int e, int f)
{
std::cout << std::setw(20) << std::left << name << std::right
<< std::setw(3) << a
<< std::setw(3) << b
<< std::setw(3) << c
<< std::setw(5) << d
<< std::setw(5) << e
<< std::setw(5) << f
<< '\n';
}
int main()
{
print_head("NFC East team", "W", "L", "T", "Pct", "PF", "PA");
print_detail("Dallas Cowboys", 13, 3, 0, 813, 421, 306);
print_detail("New York Giants",11, 5, 0, 688, 310, 284);
print_detail("Washington Redskins", 8, 7, 1, 531, 396, 383);
print_detail("Philadelphia Eagles", 7, 9, 0, 438, 367, 331);
}
|