You are on page 1of 2

#include <stdio.

h>
#include <stdlib.h>
int ave(double a,double b,double c,double d,double e)
{
double y;
y = (a + 2*b + 2*c + d + e )/7;
return(y);
}
main()
{
double P[5][5], av[5];
int s[5], i, j;
s[0]=10;
s[1]=10;
s[2]=10;
s[3]=10;
s[4]=10;
P[0][0]=45; P[0][1]=50; P[0][2]=60; P[0][3]=45; P[0][4]=60;
P[1][0]=100; P[1][1]=55; P[1][2]=60; P[1][3]=25; P[1][4]=90;
P[2][0]=55; P[2][1]=35; P[2][2]=90; P[2][3]=65; P[2][4]=80;
P[3][0]=50; P[3][1]=35; P[3][2]=40; P[3][3]=45; P[3][4]=65;
P[4][0]=60; P[4][1]=95; P[4][2]=70; P[4][3]=60; P[4][4]=55;
printf(" ae \n");
printf("a: 45 50 60 45 65 \n");
printf("b: 100 55 60 25 90 \n");
printf("c: 55 35 90 65 80 \n");
printf("d: 50 35 40 45 65 \n");
printf("e: 60 95 70 60 55 \n");
printf(" ae \n");
for(j=0;j<=4;j++)
{
for(i=0;i<=4;i++)
{
if(P[j][i]<=30)
{
s[j]=s[j]-100;
}
}
}

for(j=0;j<=4;j++)
{
av[j]=ave(P[j][0],P[j][1],P[j][2],P[j][3],P[j][4]);
if(av[j]>=60)
{
s[j]=s[j]+2;
}
}
if( s[0]>=12)
{printf("a\n");}
if( s[1]>=12)
{printf("b\n");}
if( s[2]>=12)
{printf("c\n");}
if( s[3]>=12)
{printf("d\n");}
if( s[4]>=12)
{printf("e\n");}
return(0);
}

You might also like