#include <iostream>
using namespace std;
void ym(int *p,int n);
void gys(int *p,int n);
void panduan(int *p,int n);
void paixu(int *p,int n);
void yinzi(int *p,int n);
void count(int *p,int n);
int main()
{
int cs,book_num[100],i;
int ch;
cout<<"请输入买书的次数:"<<endl;
cin>>cs;
cout<<"请输入每次买书的数量:"<<endl;
for(i=0;i<cs;i++)
cin>>book_num[i];
L1:cout<<endl;
cout<<"本题共包含6个小题目,运行各个小题目,请选择相应的题号:"<<endl<<" 第一小题请按:1"<<endl<<" 第二小题请按:2"<<endl<<" 第三小题请按:3 "<<endl<<" 第四小题请按:4 "<<endl<< " 第五小题请按:5"<<endl<<" 第六小题请按:6"<<endl;
cin>>ch;
switch(ch)
{
case 1: ym(book_num,cs); goto L1;
case 2: gys(book_num,cs); goto L1;
case 3: panduan(book_num,cs); goto L1;
case 4: paixu(book_num,cs); goto L1;
case 5: yinzi(book_num,cs); goto L1;
case 6: count(book_num,cs); goto L1;
default: goto L2;
}
L2:return 0;
}
void ym(int *p,int n)
{
int C=0;
double S;
for(i=0;i<cs;i++)
{
C=C+book_num[i];
}
cout<<"年总购书量为:"<<C<<endl;
S=C/cs;
cout<<"平均月购书量为:"<<S;
//求出年总购书量及平均月购书量,请在此大括号内编写程序
using namespace std;
void ym(int *p,int n);
void gys(int *p,int n);
void panduan(int *p,int n);
void paixu(int *p,int n);
void yinzi(int *p,int n);
void count(int *p,int n);
int main()
{
int cs,book_num[100],i;
int ch;
cout<<"请输入买书的次数:"<<endl;
cin>>cs;
cout<<"请输入每次买书的数量:"<<endl;
for(i=0;i<cs;i++)
cin>>book_num[i];
L1:cout<<endl;
cout<<"本题共包含6个小题目,运行各个小题目,请选择相应的题号:"<<endl<<" 第一小题请按:1"<<endl<<" 第二小题请按:2"<<endl<<" 第三小题请按:3 "<<endl<<" 第四小题请按:4 "<<endl<< " 第五小题请按:5"<<endl<<" 第六小题请按:6"<<endl;
cin>>ch;
switch(ch)
{
case 1: ym(book_num,cs); goto L1;
case 2: gys(book_num,cs); goto L1;
case 3: panduan(book_num,cs); goto L1;
case 4: paixu(book_num,cs); goto L1;
case 5: yinzi(book_num,cs); goto L1;
case 6: count(book_num,cs); goto L1;
default: goto L2;
}
L2:return 0;
}
void ym(int *p,int n)
{
int C=0;
double S;
for(i=0;i<cs;i++)
{
C=C+book_num[i];
}
cout<<"年总购书量为:"<<C<<endl;
S=C/cs;
cout<<"平均月购书量为:"<<S;
//求出年总购书量及平均月购书量,请在此大括号内编写程序