北京师范大学珠海分校
Judge Online of ACM ICPC
1208 As easy as a+b problem
C语言版
Judge Online of ACM ICPC
1208 As easy as a+b problem
C语言版
- #include <stdio.h>
- #include <math.h>
- int main(){
- int i;
- double l,h,a,len,sum;
- while(1){
- i=0;
- scanf("%lf%lf%lf",&l,&h,&a);
- if (l==0&&h==0&&a==0) break;
- len=h*tan(a);
- sum=len;
- while(sum<l){
- sum+=2*len;
- i++;
- }
- printf("%d %.3lf/n",i*2,l-(sum-len));
- }
- return 0;
- }