#include
int main()
{
float f,c;
f=64.0;
c=(5.0/9)*(f-32);
printf("f=%f\nc=%f\n",f,c);
return 0;
}
#include
int main()
{
float p0=1000,r1=0.0036,r2=0.0225,r3=0.0198,p1,p2,p3;
p1=p0*(1+r1);
p2=p0*(1+r2);
p3=p0*(1+r3/2)*(1+r3/2);
printf("p1=%f\np2=%f\np3=%f\n",p1,p2,p3);
return 0;
}
#include
int main()
{
char c1,c2;
c1='A';
c2=c1+32;
printf("%c\n",c2);
printf("%d\n",c2);
return 0;
}
#include
#include
int main()
{
double a,b,c,s,area;
a=3;b=5;c=6;
s=(a+b+c/2);
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("a=%f\tb=%f\tt%f\n",a,b,c);
printf("area=%f\n",area);
return 0;
}
#include
#include
int main()
{
double a,b,c,disc,x1,x2,p,q;
scanf("%lf%lf%lf",&a,&b,&c);
disc=b*b-4*a*c;
p=-b/(2.0*a);
q=sqrt(disc)/(2.0*a);
x1=p+q;x2=p-q;
printf("x1=%7.2f\nx2=%7.2f\n",x1,x2);
return 0;
}
#include
int main()
{
double a=1.0;
printf("%f\n"),a/3;
return 0;
}
#include
int main()
{
float a;
a=10000/3.0;
printf("%f\n",a);
return 0;
}
#include
int main()
{
char a='B',b='O',c='Y';
putchar(a);
putchar(b);
putchar(c);
putchar('\n');
return 0;
}
#include
int main()
{
char a,b,c;
a=getchar();
b=getchar();
c=getchar();
putchar(a);
putchar(b);
putchar(c);
putchar('\n');
return 0;
}
运行结果
#include
int main()
{
char c1,c2;
c1=getchar();
c2=c1+32;
putchar(c2);
putchar('\n');
return 0;
}