zoukankan      html  css  js  c++  java
  • c++ 学籍管理系统v 1.0

    #include<iostream>
    #include <string>
    #include<conio.h>
    using namespace std;
    class sj
    {public :
    int year,month,day;
    void shuru()
    {cin>>year>>month>>day;
    }
    };
    class student
    {
    public :
    	string xm,kc[5];
    	int bj,xh,cj[5];
    	sj time;
    	void sr()
    	{cout<<"请输入学号";
    		cin>>xh;
    		 system("cls");
    		cout<<"请输入姓名";
    		cin>>xm;
    		 system("cls");
    		 cout<<"请输入入学日期中间用空格隔开";
    		 time.shuru();
    		  system("cls") ;
    		cout<<"请输入班级";
    		cin>>bj;
    		 system("cls");
    		 cout<<"请输入课程(5门)中间用空格隔开";
    		for(int i=0;i<5;i++)
    			cin>>kc[i];
    		  system("cls");
    		  }
    	void shuruchengji()
    	{int i;
    		for(i=1;i<6;i++)
    		{
    			cout<<"请输入"<<kc[i]<<"的成绩";
    			cin>>cj[i];
    		}
    	}
    };
    string mima()
    {cout<<"请设置密码:";
    string mm1,mm2;
    char ch;
     while ((ch=_getch())!=13)
     {
      mm1+=ch;
      cout<<"*";
     }
     	 cout<<endl;
    cout<<"请再次确认密码:";
    while ((ch=_getch())!=13)
     {
      mm2+=ch;
      cout<<"*";
     }
    	 system("cls");
    if(mm1==mm2)
    return mm1;
    else
    mima();
    }
    int denglu(string mm)
    {
    	cout<<"请输入登陆密码:";
    	string mm1;
    	char ch;
     while ((ch=_getch())!=13)
     {
      mm1+=ch;
      cout<<"*";
     }	 system("cls");
    	if(mm==mm1)
    		return 1;
    	else
    	{cout<<"密码错误,您还有两次机会,请重试";
         while ((ch=_getch())!=13)
     {
      mm1+=ch;
      cout<<"*";
     }
    	 	 system("cls");
    	 if(mm==mm1)
    		return 1;
    	else
    	{cout<<"密码错误,您还有一次机会,请重试";
         while ((ch=_getch())!=13)
     {
      mm1+=ch;
      cout<<"*";
     }
    	 	 system("cls");
    	 if(mm==mm1)
    		return 1;
    	else
    	{cout<<"密码错误,请明天再试";
    	return 0;}
    	}
    	}
    }
    	int main()
    	{int n,i;
    	string mm;
    	student stu[500];
    	mm=mima();
    	i=denglu(mm);
    	if(i)
    	{	cout<<"请输入学生人数: ";
    	cin>>n;
    		 system("cls");
    	for(i=0;i<n;i++)
    		stu[i].sr();
    	int a;
    	//	while(cin>>a)
    
    	}
    return 0;
    	}

  • 相关阅读:
    进程通信方式-管道pipe
    进程间通信
    信号的发送与处理
    信号应用于事件通知
    信号的屏蔽,信号集
    信号的发送kill,raise,alarm,setitimer,abort,sigqueue
    信号处理函数的返回sigsetjmp/siglongjmp
    POJ 1562 Oil Deposits
    HDU 1016 Prime Ring Problem
    HDU 1010 Tempter of the Bone
  • 原文地址:https://www.cnblogs.com/oversea201405/p/3766979.html
Copyright © 2011-2022 走看看