• 3-5


    #include<stdio.h>
    int main(void)
    {
        double value1,value2;
        char op;
    
        printf("Type in an expression:");
        scanf("%lf%c%lf",&value1,&op,&value2);
    
        if(op=='+')
            printf("=%.2f
    ",value1+value2);
        else if(op=='-')
            printf("=%.2f
    ",value1-value2);
        else if(op=='*')
            printf("=%.2f
    ",value1*value2);
        else if(op=='/')
            printf("=%.2f
    ",value1/value2);
        else
            printf("Unknown operator
    ");
    
        return 0;
    }

  • 相关阅读:
    11
    TSP-test
    TSP-SA_TSP
    TSP-PathLength
    TSP-OutputPath
    TSP-NewAnswer
    TSP-
    TSp-dsxy2figxy
    TSP-DrawPath
    TSP-Distanse
  • 原文地址:https://www.cnblogs.com/zy1235/p/3356068.html
Copyright © 2020-2023  润新知