|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
// QQmail.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
int QQhao(FILE *fp1,FILE *fp2);
void NIcheng(int RT,FILE *fp1,FILE *fp2);
int main(int argc, char* argv[])
{
FILE *fp1=0,*fp2=0;
fp1=fopen("QQmail.txt","rb+");
fp2=fopen("QQOkmail.txt","wb+");
fprintf(fp2,"QQ号\t\t\t\t QQ昵称\n");//写入描述信息
char QKQ[]="@qq.com";
int CD=strlen(QKQ),CCD=0,RT,cok=0;
char XZ;
while(feof(fp1)==0)
{
while(QKQ[CCD]==(XZ=fgetc(fp1)))
{
if(CCD==(CD-1))
{
RT=QQhao(fp1,fp2);
NIcheng(RT,fp1,fp2);
cok++;
break;
}
CCD++;
}
CCD=0;
if(cok==1800)
{
break;
}
}
fclose(fp2);
fclose(fp1);
return 0;
}
int QQhao(FILE *fp1,FILE *fp2)
{
char *pp=fp1->_ptr-7;
char TZ[]="</span>";
int LD=strlen(TZ)-1,bas=0,QB=0,RT;
fprintf(fp1,"\n");
while(1)
{
while(TZ[LD]==*pp)
{
if(LD==0)
{
pp+=7;
RT=QB-1;
while(QB-1>0)
{
fprintf(fp2,"%c",*pp);
pp++;
QB--;
}
bas=1;
break;
}
QB++;
LD--;
pp--;
}
pp--;
if(bas==1)
{break;}
}
fprintf(fp2,"\t\t\t");
return RT;
}
void NIcheng(int RT,FILE *fp1,FILE *fp2)
{
char *pp=fp1->_ptr-185-RT-7;
char TZ[]="</span>";
int LD=strlen(TZ)-1,CX=0,bas=0,oKl=0;
while(1)
{
while(TZ[LD]==*pp)
{
if(LD==0)
{
pp+=7;
while(CX!=0)
{
fprintf(fp2,"%c",*pp);
pp++;
CX--;
}
bas=1;
break;
}
oKl=1;
LD--;
}
if(bas==1)
{
break;
}
if(oKl!=1)
{
CX++;
}
pp--;
}
fprintf(fp2,"\t\t\t\n");
return;
} |
|