编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习4
#include <iostream>
using namespace std;
const MAXSIZE=12;
int main()
{
char *month[MAXSIZE]={"Janury","February","March","April","May","June","July","August","September","October","November","December"};
int a[MAXSIZE];
int sum=0;
for(int i=0;i<MAXSIZE;i++)
{
cout<<month[i]<<": ";
cin>>a[i];
sum+=a[i];
}
cout<<"总的销量: "<<sum<<endl;
system("pause");
return 0;
}