ممكن بهذا الشكل.
#include <iostream>
using namespace std;
#define colleges 7
#define OtherOptionsRow 1
#define OtherOptionsCol 1
char size[4][25] = {
"Small", "Medium", "Large", "XLarge"
};
unsigned int savedata[colleges + OtherOptionsRow][4 + OtherOptionsCol], TotalAll = 0;
int main(int c, char **g)
{
// Input & Calc
for (int college = 0; college < colleges; college++)
{
cout << endl << "College Details ( " << college+1 << " )" << endl;
savedata[college][4] = 0;
for (int sizeidx = 0; sizeidx < 4; sizeidx++)
{
cout << "\t" << "Count Size " << size[sizeidx] << " ";
cin >> savedata[college][sizeidx];
cout << savedata[college][sizeidx];
savedata[college][4] += savedata[college][sizeidx];
}
}
cout << endl << endl;
// Output
cout << "\t" << "\t" << "\t";
for (int college = 1; college <= colleges; college++)
{
cout << college << "\t";
}
cout << "Total" << endl;
int sizeidx = 0;
for (; sizeidx < 4; sizeidx++)
{
cout << size[sizeidx] << "\t\t\t";
savedata[colleges][sizeidx] = 0;
for (int college = 0; college < colleges; college++)
{
savedata[colleges][sizeidx] += savedata[college][sizeidx];
cout << savedata[college][sizeidx] << "\t";
}
cout << savedata[colleges][sizeidx] << endl;
}
cout << "College Total\t\t\t";
for (int college = 0; college < colleges; college++)
{
TotalAll += savedata[college][sizeidx];
cout << savedata[college][sizeidx] << "\t";
}
cout << endl << "Total Quantity On Hand " << TotalAll << endl;
}