zoukankan      html  css  js  c++  java
  • 作业3-6 查询水果的单价。有 4 种水果,苹果(apples)、梨(pears)、桔子(oranges)和葡萄(grapes),单价分别是 3.00 元/公斤,2.50 元/公斤,4.10 元/公斤和 10.20 元/公斤。在屏幕上显示以下菜单(编号和选项),用户可以连续查询水果的单价,当查询次数

    #include<stdio.h>
    int main(void)
    {
        int choice,i;
        double price;
    
        for(i=1;i<=5;i++){//根据题目要求要循环5次
            printf("[1]apples 3.00
    ");//输出的价格
            printf("[2]pears 2.50
    ");
            printf("[3]oranges 4.10
    ");
            printf("[4]grapes 10.20
    ");
            printf("[0]Exit
    ");
    
            printf("Enter choice:");
            scanf("%d",&choice);
            if(choice==0)//当输入选择为0是跳出
                break;
        }
        return 0;
    }

  • 相关阅读:
    C#
    C#
    SQLServer
    C#
    使用Spring Boot快速构建应用
    mysql (master/slave)复制原理及配置
    Mysql 半同步复制配置
    Mysql+keeplived+lvs
    Mysql实时双备
    mysqlbinlog 用法
  • 原文地址:https://www.cnblogs.com/chengruiqiking/p/3385468.html
Copyright © 2011-2022 走看看