#include<iostream>
int main()
{
double a=5;
double b=1;
double c;
double result;
for(int i=0;i<3;i++)
{
c=1/a;
result=b+c;
a=result;
}
printf("%f",result);
return result;
}
#include<iostream>
#include<math.h>
int main()
{
int a=3;
int b=4;
double y=sqrt(a*a+b*b);
printf("%f",y);
return 0;
}
#include<iostream>
#include<math.h>
#define PI 3.1415926
int main()
{
double a=PI/4;
double y=sin(a)*sin(a)+sin(a)*cos(a)-cos(a)*cos(a);
printf("%f",y);
return 0;
}
#include<iostream>
#include<math.h>
#define PI 3.1415926
int main()
{
double a=log(3);
double b=log(2);
double c=PI/3;
double y=(log(5*a)-b)/sin(c);
printf("%f",y);
return 0;
}
#include<iostream>
#include<math.h>
int main()
{
double a=(3/4+103)%3;
printf("%f",a);
return 0;
}
// 两个数进行取余只能是两个整数,所以a=0.75+103 y=a%3是错误的
#include<iostream>
#include<math.h>
int main()
{
int a=ceil(3.8);
int b=ceil(-3.8);
int c=floor(3.2);
int d=floor(-3.2);
printf("%d %d %d %d",a,b,c,d);
return 0;
}