#include <bits/stdc++.h> using namespace std; int main() { cout<<"欢迎来到c++饭店"<<endl; int ren = 0; double price = 0,g = 0,sum = 0; //string mi = 0; cout<<"开始营业了吗? (y/n)"; char yy; cin>>yy; while(yy == 'y'){ ren++; cout<<"欢迎第"<<ren<<"个顾客:"<<endl; double m = 0; int s = 0; while(1){ s++; cout<<"请点菜"<<endl; cout<<"请输入第"<<s<<"件商品的价格"<<endl; cin>>price; //cout<<"元的"<<endl; //cout<<"商品名称是"; //cin>>mi; cout<<"请输入第"<<s<<"件商品的数量"<<endl; cin>>g; cout<<"元的"<<endl; cout<<"还买吗?"<<endl; m = m+(price*g); if(price == 0){ break; } } cout<<"吃饱喝足啦!您的消费金额="<<m<<"元!"<<endl; cout<<"继续营业吗?"; cin>>yy; sum+=m; if(sum>10000000){ cout<<"你来晚了,你……买完了"<<endl; break; } } cout<<"营业结束!顾客数="<<ren<<",营业额="<<sum<<endl; return 0; }

6 条评论

  • rr

    • @ 2025-5-24 19:03:29

      大型记录片之《点菜》

      • @ 2025-5-24 9:50:59

        666

        • @ 2025-5-23 17:13:22

          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

          • @ 2025-5-23 17:08:54

            ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

            • @ 2025-5-23 16:07:32

              ………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………

              • @ 2025-5-23 16:08:45

                nishigeda^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^hahahahahahahahahahahahahahahahahahahahahahah

              • @ 2025-5-24 11:07:57

                哈哈哈

            • 1

            信息

            ID
            765
            时间
            1000ms
            内存
            256MiB
            难度
            9
            标签
            (无)
            递交数
            141
            已通过
            10
            上传者