#include
int main()
{
float a,b,c,t;
scanf_s("%f,%f,%f",&a,&b,&c);
if (a > b)
{
t = a; a = b; b = t;
}
if (a > c)
{
t = a; a = c; c = t;
}
if (b > c)
{
t = b; b = c; c = t;
}
printf("%5.2f,%5.2f,%5.2fn",a,b,c);
return 0;
}
#include
#include
int main()
{
double x,y;
printf("输入x的值:");
scanf_s("%lf",&x);
if (x <= 1)
y = exp(x);
else
y = pow(x, 2) - 1;
printf("f(%f)=%.2fn",x,y);
return 0;
}
#include
int main()
{
int a, b;
printf("请输入两个整数:");
scanf_s("%d%d",&a,&b);
if (a > b)
printf("两个整数中的最大值为:%dn", a);
else
printf("两个整数中的最大值为:%dn",b);
return 0;
}
xhq 2021/11/12 9:26:16
#include
#include
int main()
{
float x, y;
printf("输入x的值:");
scanf_s("%f",&x);
if (x < 2)
y = 2 * x;
else if (x <= 10)
y = 7 - 3 * x;
else
y = 1 - cos(x);
printf("y=%0.6fn",y);
return 0;
}
xhq 2021/11/12 9:31:01
#include
int main()
{
char c1, c2;
printf("请输入一个字符:");
c1 = getchar();
if (c1 >= 'a' && c1 <= 'z')
c2 = c1 - 32;
else if (c1 >= 'A' && c1 <= 'Z')
c2 = c1 + 32;
else
c2 = c1 + 1;
putchar(c2);
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)