You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sjx_001/产品销售统计系统.cpp

92 lines
3.9 KiB

6 years ago
#include<stdio.h>
#include<stdlib.h>
void menue()
{
int z;
int m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,c1,c2,c3,c4,c5,A,B,D,E,F,G,H,I,J,K,L,N,O,P,Q,R,Z,T,X,Y;
int M[4][5]={{m1,m2,m3,m4,m5},{m6,m7,m8,m9,m10},{m11,m12,m13,m14,m15},{m16,m17,m18,m19,m20}};
int S[4][5]={{s1,s2,s3,s4,s5},{s6,s7,s8,s9,s10},{s11,s12,s13,s14,s15},{s16,s17,s18,s19,s20}};
int C[5]={c1,c2,c3,c4,c5};
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ֲ<EFBFBD>Ʒ<EFBFBD>ĵ<EFBFBD><EFBFBD>ۣ<EFBFBD>ÿ<EFBFBD>ֲ<EFBFBD>Ʒÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
printf("<EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
printf(" (1) (2) (3) (4) (5)\n");
printf("<EFBFBD>۸<EFBFBD>(Ԫ)<29><>");
scanf("%d %d %d %d %d",&c1,&c2,&c3,&c4,&c5);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
printf(" (1) (2) (3) (4) (5)\n");
printf("<EFBFBD><EFBFBD>һ<EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&m1,&m2,&m3,&m4,&m5);
printf("<EFBFBD>ڶ<EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&m6,&m7,&m8,&m9,&m10);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&m11,&m12,&m13,&m14,&m15);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&m16,&m17,&m18,&m19,&m20);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
printf("<EFBFBD><EFBFBD>һ<EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&s1,&s2,&s3,&s4,&s5);
printf("<EFBFBD>ڶ<EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&s6,&s7,&s8,&s9,&s10);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&s11,&s12,&s13,&s14,&s15);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>");
scanf("%d %d %d %d %d",&s16,&s17,&s18,&s19,&s20);
m1=m1*c1;m2=m2*c2;m3=m3*c3;m4=m4*c4;m5=m5*c5;
m6=m6*c1;m7=m7*c2;m8=m8*c3;m9=m9*c4;m10=m10*c5;
m11=m11*c1;m12=m12*c2;m13=m13*c3;m14=m14*c4;m15=m15*c5;
m16=m16*c1;m17=m17*c2;m18=m18*c3;m19=m19*c4;m20=m20*c5;
s1=s1*c1;s2=s2*c2;s3=s3*c3;s4=s4*c4;s5=s5*c5;
s6=s6*c1;s7=s7*c2;s8=s8*c3;s9=s9*c4;s10=s10*c5;
s11=s11*c1;s12=s12*c2;s13=s13*c3;s14=s14*c4;s15=s15*c5;
s16=s16*c1;s17=s17*c2;s18=s18*c3;s19=s19*c4;s20=s20*c5;
A=m1+m2+m3+m4+m5;B=m6+m7+m8+m9+m10+m11;
D=m11+m12+m13+m14+m15;E=m16+m17+m18+m19+m20;
F=s1+s2+s3+s4+s5;G=s6+s7+s8+s9+s10;
H=s11+s12+s13+s14+s15;I=s16+s17+s18+s19+s20;
J=m1+m6+m11+m16;K=m2+m7+m12+m17;L=m3+m7+m13+m18;N=m4+m8+m14+m19;O=m5+m10+m15+m20;
P=s1+s6+s11+s16;Q=s2+s7+s12+s17;R=s3+s7+s13+s18;Z=s4+s8+s14+s19;T=s5+s10+s15+s20;
X=A+B+D+E;
Y=F+G+H+I;
while(1)
{
printf("\n***************************************");
printf("\nѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>): *");
printf("\n1.ÿ<>ֲ<EFBFBD>Ʒÿ<C6B7>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ *");
printf("\n2.ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ *");
printf("\n3.ÿ<>ֲ<EFBFBD>Ʒһ<C6B7><D2BB><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>*");
printf("\n4.<2E><><EFBFBD>в<EFBFBD>Ʒһ<C6B7><D2BB><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>*");
printf("\n5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*");
printf("\n***************************************\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%d",&z);
switch(z)
{
case 1: printf("ÿ<EFBFBD>ֲ<EFBFBD>Ʒÿ<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:\n (1) (2) (3) (4) (5)\nWeek(1)= %d %d %d %d %d\nWeek(2)= %d %d %d %d %d\nWeek(3)= %d %d %d %d %d\nWeek(4)= %d %d %d %d %d\nÿ<EFBFBD>ֲ<EFBFBD>Ʒÿ<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:\n (1) (2) (3) (4) (5)\nWeek(1)= %d %d %d %d %d\nWeek(2)= %d %d %d %d %d\nWeek(3)= %d %d %d %d %d\nWeek(4)= %d %d %d %d %d\n",m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20);break;
case 2: printf("ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:\n (<28><>) (<28><>)\nWeek(1)= %d %d\nWeek(2)= %d %d\nWeek(3)= %d %d\nWeek(4)= %d %d\n",A,F,B,G,D,H,E,I);break;
case 3: printf("ÿ<EFBFBD>ֲ<EFBFBD>Ʒһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:\n (<28><>) (<28><>)\nProduct(1)= %d %d\nProduct(2)= %d %d\nProduct(3)= %d %d\nProduct(4)= %d %d\nProduct(5)= %d %d\n",J,P,K,Q,L,R,N,Z,O,T);break;
case 4: printf("<EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>Ʒһ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:\nTotal product=%d\nTotal sales=%d\n",X,Y);break;
case 5: exit(0);break;
}
}
}
int main(void)
{
system("color b0");
menue();
return 0;
}