#include<stdio.h>
#include<math.h>
#define pI 3.1415926
int main()
{
float r,theta,x,y;
scanf("%f %f",&r,&theta);//双引号之间不可空格,否则会出错
x=r*cos(theta/180*pI);
y=r*sin(theta/180*pI);
printf("%f %f",x,y);
return 0;
}
![](https://i-blog.csdnimg.cn/blog_migrate/e8c6b90ce87fb159cc7b48ae48502d96.png)
#include<stdio.h>
#include<math.h>
#define pI 3.1415926
int main()
{
float r,theta,x,y;
scanf("%f %f",&r,&theta);//双引号之间不可空格,否则会出错
x=r*cos(theta/180*pI);
y=r*sin(theta/180*pI);
printf("%f %f",x,y);
return 0;
}