|
|
back to boardResult Posted by Ion 27 Oct 2017 19:35 #include <stdio.h> #include <stdlib.h> int main() { int a,p=0,i,*b; float f,s=0; scanf("%d",&a); b=(int *)malloc(sizeof(int)*a); for(i=0;i<a;i++){ scanf("%d",&b[i]);} /*if (b[i]<3||b[i]>5) scanf("%d",&b[i]); }*/ for(i=0;i<a;i++) s+=b[i]; f=s/a; for(i=0;i<a;i++) { if(b[i]==3){ p=1;} } if(f==5) {printf("Named"); } else if(f>=4.5&&p==0){ printf("High"); } else if(f<4.5&&p==0){ printf("Common");} else {printf("None");} free(b); return 0; } |
|
|