hdu2080-2081

hdu2080

计算两点关于原点夹角,数学

 #include<stdio.h>
#include<math.h>
double len(double x1,double y1,double x2,double y2){
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main(){
int T;
while(scanf("%d",&T)!=EOF){
for(int q=;q<=T;q++){
double x1,y1,x2,y2;
double a,b,c;
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
a=len(,,x1,y1);
b=len(,,x2,y2);
c=len(x1,y1,x2,y2);
double cos1=(a*a+b*b-c*c)/(*a*b);
double t=acos(cos1)*/3.14159;
printf("%.2lf\n",t);
}
}
return ;
}

hdu2081

模拟

 #include<stdio.h>

 int main(){
int N;
while(scanf("%d",&N)!=EOF){
for(int q=;q<=N;q++){
char a[];
scanf("%s",a);
printf("");
for(int i=;i<=;i++)printf("%c",a[i]);
printf("\n");
getchar();
}
}
return ;
}
上一篇:JSP中的隐式对象(implicit object)


下一篇:JSP九个隐式对象及作用域