栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

无标题2(第四章总结2)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

无标题2(第四章总结2)

#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;
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/649403.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号