⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shichang.cpp

📁 汽车生产公司系统管理程序 是为解决一个汽车生产公司的电脑化管理问题的系统管理程序
💻 CPP
字号:
//shichang.cpp
#include<iostream.h>
#include<fstream.h>
#include<stdlib.h>
#include<stdio.h>
#include"xiaoshou.h"

void market()
{   
	int j,n=0;
    while(1)
    {
		cout<<endl<<"请选择要进行的操作:"<<endl;
	    cout<<"1.输入市场信息"<<endl;
        cout<<"2.查看销售额数据"<<endl;
        cout<<"3.浏览市场信息"<<endl;
	    cout<<"0.返回"<<endl;
		cin>>j;
	    switch(j)
		{
		    case 1:
			{
				char s[2048];
				ofstream outstuf;
	            outstuf.open("D:\\吴勇\\companyfile\\市场文件.txt",ios::app);
	            if(!outstuf)
				{
					cerr<<"不能打开文件!"<<endl;
                    abort();
				}
	            cout<<"请输入市场信息:"<<endl;
	            cin>>s;
				outstuf<<"市场信息"<<s<<endl;
				cout<<"信息已输入"<<endl;
				outstuf.close();
	            break;
			}	
	    case 2:
			{
				ifstream instuf("D:\\吴勇\\companyfile\\销售文件.txt",ios::in);
	            if(!instuf)
				{
		            cerr<<"不能打开文件!"<<endl;
                    abort();
				}
                ifstream inf("D:\\吴勇\\companyfile\\销售文件.txt",ios::in);
                char s[80];    
                for(int i=1;i<=0;i++)
	            inf.getline(s,80);  
                while(!inf.eof())
	            {
				    inf.getline(s,80);
                    cout<<s<<endl;
			    }   	
                inf.close();           
				break;
			}
		case 3:
			{
				char s[80];
				ifstream instuf("D:\\吴勇\\companyfile\\市场文件.txt",ios::in);
                if(!instuf)
				{
		            cerr<<"不能打开文件!"<<endl;
                    abort();
				}
 			    for(int i=1;i<=0;i++)
                   instuf.getline(s,80); 			
                while(!instuf.eof())
				{
					instuf.getline(s,80);
					cout<<s<<endl;
				}
			    instuf.close();
			    break;
			}
		case 0:return;
        default:cout<<endl<<"选择错误,请再输入"<<endl;
		
			}
		}
	}
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -