/* diving.tc - tct - 11/12/2010 1/17/2011 diving [ pl "In the sport of diving, seven judges award a score between 0 and 10, eg." pl "5.7. The highest and lowest scores are thrown out and the remaining" pl "scores are added together. The sum is then multiplied by the degree of" pl "difficulty for that dive, a number from 1.2 to 3.8. The total is then" pl "multiplied by 0.6 to determine the diver's score." pl "";sak;pl "" int score(6),dod,i,ls,hs,ils,ihs,total while ((dod<=12)+(dod>=38)) [ ps "degree of difficulty (12 to 38) : ";dod=gn ] ps "degree of difficulty : "; pn dod/10;ps ".";dpf(dod%10,10,1);pl "" ls=10;hs=0 i=0 while i<7 [ score(i)=11 while ((score(i)<0)+(score(i)>10)) [ ps "score ";pn i+1;ps " (0 to 10): ";score(i)=gn ] if score(i)hs [hs=score(i);ihs=i] i=i+1 ] if ils==ihs [ils=0;ihs=6] i=0 while i<7 [ if ((i!=ils)*(i!=ihs)) total=total+score(i) i=i+1 ] total=total*dod*6 ps "score : ";pn total/100;ps "." dpf(total%100,100,1) pl "" ] dpf int n,d,p [ if p [pn 10*n/d;dpf 10*n%d,d,p-1] ] pn int n [ MC n,14 ] sak [ char c;pl "Strike Any Key ";c=getchar ]