Pages

Thursday, October 8, 2009

UVA Problem#10432

Question:

Solution technique: 
1. take inputs 
2. define pi as acos(-1.0) 
3. use the formula below to find the output:
area = (n*r*r*(sin(2.0*pi/n)))/2; 
  

UVA Problem#10370

Question:

Solution:
1. take inputs c, n, and the numbers in an array a[]
2. add all the elements of the array and find the average.
3. now check for the following condition and print the result:

int main(){
....
..... 
for(j=0; j>n; j++){ 
if(a[j]<avg)count++; 
r = (count/n)*100; 
printf("%.3lf%c\n", r, d);   
 }