#include #include main() { int name,kala,tedad,f,j,m,i,a,tarikh,n,A,B,C,D,E,s1,s2,s3,s4; int v[4][30],w[4][30],x[4][30],y[4][30],z[4][30]; char k,t,e; clrscr(); for(i=0;i<4;i++){ for(j=0;j<30;j++){ v[i][j]=0; w[i][j]=0; x[i][j]=0; y[i][j]=0; z[i][j]=0;} } printf(" \n daryafte etelaate mahaye ghabl \n\n\n"); do { printf(" \n tarikhe forush ra vared konid: "); scanf("%d",&tarikh); printf(" \n\nname forushande ra vared konid:(a,b,c,d) "); k=getche(); switch (k){ case 'a' : a=1; break; case 'b' : a=2; break; case 'c' : a=3; break; case 'd' : a=4; break; } name=a-1; printf("\n shomareye kala ra vared konid: "); scanf("%d",&kala); printf("\n tedade forukhte shode ra vared konid: "); scanf("%d",&tedad); tarikh--; switch (kala){ case 1 : v[name][tarikh]=tedad; break; case 2 : w[name][tarikh]=tedad; break; case 3 : x[name][tarikh]=tedad; break; case 4 : y[name][tarikh]=tedad; break; case 5 : z[name][tarikh]=tedad; break; } printf("\n aya kare vared kardane etelaat payan yaft?(y/n): "); t=getche(); } while(t=='y'); printf("\n\n\n\n aya mayel be chape etelaat hastid?(y/n): "); e=getche(); if(e=='y'){ printf("\n\n chape etelaat be soorate zir ast "); printf("\n baraye mesal: "); printf("\n V1,13 yani mahsule V va forushandeye shomare 1 dar tarike 13e mah \n "); f=0; while (f==0){ printf("\n\n\n "); m=0; for(i=0;i<4;i++){ for (j=0;j<30;j++){ m=i+1; n=j+1; printf("V%d,%d = %d \t",m,n,v[i][j]);}} printf("\n\n\n "); m=0; for(i=0;i<4;i++) { for (j=0;j<30;j++){ m=i+1; n=j+1; printf("W%d,%d = %d \t",m,n,w[i][j]);}} printf("\n\n\n "); m=0; for(i=0;i<4;i++) { for (j=0;j<30;j++){ m=i+1; n=j+1; printf("X%d,%d = %d \t",m,n,x[i][j]);}} printf("\n\n\n "); m=0; for(i=0;i<4;i++) { for (j=0;j<30;j++){ m=i+1; n=j+1; printf("Y%d,%d = %d \t",m,n,y[i][j]);}} printf("\n\n\n "); m=0; for(i=0;i<4;i++) { for (j=0;j<30;j++){ m=i+1; n=j+1; printf("Z%d,%d = %d \t",m,n,z[i][j]);}} f++; } } s1=s2=s3=s4=0; for (j=0;j<30;j++){ s1=(s1+v[0][j]+w[0][j]+x[0][j]+y[0][j]+z[0][j]); s2=(s2+v[1][j]+w[1][j]+x[1][j]+y[1][j]+z[1][j]); s3=(s3+v[2][j]+w[2][j]+x[2][j]+y[2][j]+z[2][j]); s4=(s4+v[3][j]+w[3][j]+x[3][j]+y[3][j]+z[3][j]); } printf("\n\n meghdare forushe har FORUSHANDEH dar yekmahe gozashte :\n\n A=%d , B=%d , C=%d , D=%d ",s1,s2,s3,s4); A=B=C=D=E=0; for(i=0;i<4;i++) { for (j=0;j<30;j++){ A=A+v[i][j]; B=B+w[i][j]; C=C+x[i][j]; D=D+y[i][j]; E=E+z[i][j];}} printf("\n\n meghdare forushe har MAHSUL dar yekmahe gozashte :\n\n V=%d , W=%d , X=%d , Y=%d , Z=%d",A,B,C,D,E); getch(); return(0); }