c++课程设计,职工管理系统

#include <iostream>
#include <string>
#include <set>
#include <windows.h>
#include <cstdio>
#include <conio.h>
#include <cmath>
#include <fstream>
#define I 12 //爱心的上半部分两个小半圆的半径
#define R 240 //爱心的下半部分圆弧曲线半径
using namespace std;
class zhigong//职工类,表示单个职工
{
    string nam;//姓名
    string gh;//工号
    bool sex;//性别
    string sr;//生日
    string xl;//学历
    string zw;//职务
    int gz;//工资
    string zhu;//住址
    string tel;//电话
public:
    bool operator < (const  zhigong &b) const;//为set提供排序方式
    zhigong(string _nam,string _gh,bool _sex,string _sr,string _xl,string _zw,int _gz,string _zhu,string _tel);
    zhigong();
    zhigong(string x);//为工号查找提供简易构造函数
    void prin();//屏幕输出
    friend ostream& operator << (ostream &out,const zhigong& b);//为文件对象提供输出
    void change();//修改
    string na();//为姓名模糊查找提供nam
};
class zgxt:public set<zhigong>//继承STL_set作为程序主题类表示职工系统类,作为平衡红黑二叉树树存储
{
public:
    void sdin();//手动插入
    void shuc();//输出
    zgxt::iterator mhfind(string _na);//模糊查找姓名
} acm;//定义一个对象acm表示职工的集合
void gotoxy(int x,int y)
{

    COORD loc;
    loc.X  =  y;
    loc.Y  =  x;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), loc);
}//坐标定位函数
void xinxing()//欢迎界面
{
    int i,j,e,a;
    for(i=1,a=I; i<I/2; i++,a--)//爱心的上半部分 为两个实心半圆
    {
        for(j=(int) ( I-sqrt((double)(I*I-(a-i)*(a-i))) ); j>0; j--)
            printf(" ");
        for(e=1; e<=2*sqrt((double)(I*I-(a-i)*(a-i))); e++)
            printf("\3");
        for(j=(int) ( 2*( I-sqrt((double)(I*I-(a-i)*(a-i))) ) ); j>0; j--)
            printf(" ");
        for(e=1; e<=2*sqrt( (double) (I*I-(a-i)*(a-i)) ); e++)
            printf("\3");
        printf("\n");
    }
    for(i=1; i<56; i++)//爱心的中间一行 可以打印一些标记
    {
        if(i==14)
        {
            printf("\3\3\3\3\3 ~Welcome~ \3\3\3\3\3\3");
            i+=30;
        }
        printf("\3");
    }
    printf("\n");
    for(i=1; i<=R/2; i++)//爱心的下半部分 以R为半径的左右两条圆弧曲线 R设置为比较大
    {
        if(i%2||i%3)continue;//因为R很大 两条曲线应该删去中间的一些点 这样就会更像爱心
        for(j=(int) ( R-sqrt( (double) (R*R-i*i) ) ); j>0; j--)
            printf(" ");
        for(e=1; e<=2*( sqrt( (double)(R*R-i*i) ) - (R-2*I) ); e++)
            printf("\3");
        printf("\n");
    }
    gotoxy(0,79);//以下是控制变色
    system("color a");
    if(kbhit())
        return;
    Sleep(500);
    system("color b");
    if(kbhit())
        return;
    Sleep(500);
    system("color c");
    if(kbhit())
        return;
    Sleep(500);
    system("color d");
    system("color e");
    if(kbhit())
        return;
    Sleep(500);
    system("color f");
    if(kbhit())
        return;
    Sleep(500);
    system("color 0");
    if(kbhit())
        return;
    Sleep(500);
    system("color 1");
    if(kbhit())
        return;
    Sleep(500);
    system("color 2");
    system("color 3");
    if(kbhit())
        return;
    Sleep(500);
    system("color 4");
    if(kbhit())
        return;
    Sleep(500);
    system("color 5");
    if(kbhit())
        return;
    Sleep(500);
    system("color 6");
    if(kbhit())
        return;
    Sleep(500);
    system("color 7");
    system("color 8");
    if(kbhit())
        return;
    Sleep(500);
    system("color 9");
    system("color ab");
    if(kbhit())
        return;
    Sleep(500);
    system("color ac");
    if(kbhit())
        return;
    Sleep(500);
    system("color ad");
    if(kbhit())
        return;
    Sleep(500);
    syst
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值