📄 main.cpp
字号:
#include <process.h>
#include <string.h>
#include <iomanip.h>
#include "data.h"
#include "shixian.h"
/****************************************************
文件名:程序计数器主函数;
简要描述:将各模块组装起来的Main函数(驱动程序),完成编码
*****************************************************/
void main()
{
char line[]={"━━━━━━━━━━"};
char bar[]={"...."};
int i,j,k=0,x=0,y=0;
for(i=1;i<=strlen(line)/2;)
{
system("cls");
for(j=0;j<9;j++) //改变行坐标
cout<<endl;
for(j=0;j<(75-strlen(line))/2;j++) //改变列坐标
cout<<" ";
for(j=1;j<=i;j++) //进度显示器
cout<<"■";
for(x=strlen(line)/2;x>i;x--)
cout<<"□";
if(k==4)
i++;
cout<<endl;
for(j=0;j<(75-strlen(line))/2;j++) //行坐标定位
cout<<" ";
cout<<line; //输出线条
cout<<endl;
for(j=0;j<(65-strlen(bar))/2;j++)
cout<<" ";
cout<<(i-1)*10<<"% Loading";
cout.write(bar,k);
cout<<endl;
for(j=0;j<10;j++)
cout<<endl;
for(j=0;j<24;j++)
cout<<" ";
cout<<"程序设计:软件工程(2)班制作"<<endl;
for(j=0;j<24;j++)
cout<<" ";
for(j=0;j<=12;j++)
cout<<"─";
cout<<endl;
for(j=0;j<10000000;j++); //延时效果
k++;
if(k>4)
k=0;
}
system("cls"); //清屏函数
BLCK_Q *INF_BLCK_NW;
BLCK_Q *INF_BLCK_OLD;
BLCK_Q *RSLT_BLCK_Q;
char str_nw[50];
char str_old[50];
int inputflag=1;
char inputc;
int fini=0;
INF_BLCK_NW=(BLCK_Q *)malloc(sizeof(BLCK_Q));
INF_BLCK_NW->head=(INF_BLCK *)malloc(sizeof(INF_BLCK));
INF_BLCK_NW->head->next=NULL;
INF_BLCK_NW->rear=INF_BLCK_NW->head;
INF_BLCK_OLD=(BLCK_Q *)malloc(sizeof(BLCK_Q));
INF_BLCK_OLD->head=(INF_BLCK *)malloc(sizeof(INF_BLCK));
INF_BLCK_OLD->head->next=NULL;
INF_BLCK_OLD->rear=INF_BLCK_OLD->head;
RSLT_BLCK_Q=(BLCK_Q *)malloc(sizeof(BLCK_Q));
RSLT_BLCK_Q->head=(INF_BLCK *)malloc(sizeof(INF_BLCK));
RSLT_BLCK_Q->head->next=NULL;
RSLT_BLCK_Q->rear=RSLT_BLCK_Q->head;
printf("\n\n ☆----欢迎使用变化计数器----☆ \n");
while(inputflag)
{
inputflag=0;
printf("\n请输入新代码的文件路径:");
flushall();
gets(str_nw);
printf("\n请输入旧代码的文件路径:");
flushall();
gets(str_old);
if((fp_nw=fopen(str_nw,"r"))==NULL)
{
printf("\n Open %s error!!!\n",str_nw);
inputflag=1;
}
if((fp_old=fopen(str_old,"r"))==NULL)
{
printf("\n Open %s error!!!\n",str_old);
inputflag=1;
}
if(inputflag)
{
strcpy(str_nw,"");
strcpy(str_old,"");
printf("\nREPEAT it or EXIT!\n1.REPEAT 2.EXIT\n");
flushall();
inputc=getchar();
while(!((inputc=='1')||(inputc=='2')))
{
printf("\nInput error! Repeat it!");
printf("\nREPEAT it or EXIT!\n1.重新输入 2.退出\n");
flushall();
inputc=getchar();
}
if(inputc=='2')
exit(0);
}
}
printf("\n输入修改日期:");
gets(strdate);
printf("\n输入修改者:");
gets(strauthur);
printf("\n输入修改原因:");
gets(strreason);
printf("\n**********************************\n");
while(fini==0)
{
fini=ExtrCmp(INF_BLCK_NW,INF_BLCK_OLD,RSLT_BLCK_Q);
OtptRslt(RSLT_BLCK_Q);
}
if(max1>=max2)
max=max1;
else max=max2;
if(same/max<0.01)
{
printf("\n您比较的这两个文件是不同的文件\n");
exit(0);
}
Otpt2Rslt();
printf("\n软件工程(2)班制作!\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -