?? main.cpp
字號(hào):
#include <process.h>
#include <string.h>
#include <iomanip.h>
#include "data.h"
#include "shixian.h"
/****************************************************
文件名:程序計(jì)數(shù)器主函數(shù);
簡(jiǎn)要描述:將各模塊組裝起來(lái)的Main函數(shù)(驅(qū)動(dòng)程序),完成編碼
*****************************************************/
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++) //改變行坐標(biāo)
cout<<endl;
for(j=0;j<(75-strlen(line))/2;j++) //改變列坐標(biāo)
cout<<" ";
for(j=1;j<=i;j++) //進(jìn)度顯示器
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++) //行坐標(biāo)定位
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<<"程序設(shè)計(jì):軟件工程(2)班制作"<<endl;
for(j=0;j<24;j++)
cout<<" ";
for(j=0;j<=12;j++)
cout<<"─";
cout<<endl;
for(j=0;j<10000000;j++); //延時(shí)效果
k++;
if(k>4)
k=0;
}
system("cls"); //清屏函數(shù)
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 ☆----歡迎使用變化計(jì)數(shù)器----☆ \n");
while(inputflag)
{
inputflag=0;
printf("\n請(qǐng)輸入新代碼的文件路徑:");
flushall();
gets(str_nw);
printf("\n請(qǐng)輸入舊代碼的文件路徑:");
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您比較的這兩個(gè)文件是不同的文件\n");
exit(0);
}
Otpt2Rslt();
printf("\n軟件工程(2)班制作!\n");
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -