#include <iostream>
#include <cmath>
using namespace std;
const double TINY_VALUE=1e-5;
double tsin (double x){
double g=0;
double t=x;
int n=1;
do{
g+=t;
n++;
t=-t*x/(2*n-1)/(2*n-2);
}while(fabs(t)>=TINY_VALUE);
return g;
}
int main(){
double m,s;
cout<<"Please input a real number:";
cin>>m;
s=1-tsin(m);
cout<<s<<endl;
return 0;
}
#include <cmath>
using namespace std;
const double TINY_VALUE=1e-5;
double tsin (double x){
double g=0;
double t=x;
int n=1;
do{
g+=t;
n++;
t=-t*x/(2*n-1)/(2*n-2);
}while(fabs(t)>=TINY_VALUE);
return g;
}
int main(){
double m,s;
cout<<"Please input a real number:";
cin>>m;
s=1-tsin(m);
cout<<s<<endl;
return 0;
}