parent
91ccbe0fb1
commit
9bb90493a8
Binary file not shown.
@ -1,40 +0,0 @@
|
||||
#include<stdio.h>
|
||||
int main(void)
|
||||
{
|
||||
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,number,A,B,D,E,F,G,H,I,J,K,L,N,O,P,Q,R,S,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("请输入每种产品的单价:\n");
|
||||
scanf("%d%d%d%d%d\n",c1,c2,c3,c4,c5);
|
||||
printf("请输入每种产品每周生产值:\n");
|
||||
scanf("%d%d%d%d%d\n%d%d%d%d%d\n%d%d%d%d%d\n%d%d%d%d%d\n\n",&m1,&m2,&m3,&m4,&m5,&m6,&m7,&m8,&m9,&m10,&m11,&m12,&m13,&m14,&m15,&m16,&m17,&m18,&m19,&m20);
|
||||
printf("请输入每种产品每周销售值:\n");
|
||||
scanf("%d%d%d%d%d\n%d%d%d%d%d\n%d%d%d%d%d\n%d%d%d%d%d\n\n",&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10,&s11,&s12,&s13,&s14,&s15,&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;S=s4+s8+s14+s19;T=s5+s10+s15+s20;
|
||||
X=A+B+D+E;
|
||||
Y=F+G+H+I;
|
||||
scanf("%d",&number);
|
||||
switch(number)
|
||||
{
|
||||
case1:printf("每种产品每周的生产值:\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每种产品每周的销售值:\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;
|
||||
case2:printf("每周所有产品的生产值和销售值:\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;
|
||||
case3:printf("每种产品一个月内的生产值和销售值:\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,S,O,T);break;
|
||||
case4:printf("所有产品一个月的生产总值和销售总值:\nTotal product=%d\nTotal sales=%d\n",X,Y);break;
|
||||
case5:break;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue