//#include "stdafx.h"
#include
using namespace std;
void PrintArray(char warename[][10],int len,int sum[][12])
{
for (int i=0;i<3;i++)
{
cout << "商品名称:" << warename[i] <
for (int j=0;j<12;j++)
s += sum[i][j];
cout << "12个月总销量:" << s << endl;
}
}
int main()
{
//商品名称
char warename[3][10] = {{"电视机"},{"冰箱"},{"空调"}};
//商品12个月的销量
int sellsum[3][12] = {{35,46,24,50,46,23,54,30,40,31,26,49},
{46,58,47,95,68,75,46,35,42,41,36,32},
{65,98,46,53,85,74,68,24,35,63,55,64}};
//输出商品及12个月的销量
PrintArray(warename,3,sellsum);
return 0;
}
using namespace std;
也可以在把#include
#include "stdafx.h"
#include
using namespace std; //加上这句
"#include
在这加上using namespace std;