?? 字幕校正.cpp
字號:
// 字幕校正.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
FILE *fpi,*fpo;
int main(int argc, char* argv[])
{
int h,m,s;
char tmp[220];
if( !(fpi=fopen("xp-abl.idx","r")) )
{
printf("fail to open file xp-abl.idx\n");
return -1;
}
if( !(fpo=fopen("xp-abl(correct).idx","w")) )
{
printf("fail to open file xp-abl(correct).idx\n");
return -1;
}
while(!feof(fpi))
{
fgets(tmp,100,fpi);
if(!strncmp(tmp,"timestamp:",10))
{
printf("---%s",tmp);
h=(tmp[11]-'0')*10 + (tmp[12]-'0');
m=(tmp[14]-'0')*10 + (tmp[15]-'0');
s=(tmp[17]-'0')*10 + (tmp[18]-'0');
s=s-54;
if(s<0)
{
m=m-1;
s=s+60;
}
if(m<0)
{
h=h-1;
m=m+60;
}
tmp[11]=h/10 + '0';
tmp[12]=h-h/10*10 + '0';
tmp[14]=m/10 + '0';
tmp[15]=m-m/10*10 + '0';
tmp[17]=s/10 + '0';
tmp[18]=s-s/10*10 + '0';
printf("+++%s",tmp);
}
fprintf(fpo,"%s",tmp);
}
getchar();
fclose(fpi);
fclose(fpo);
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -