#import<Foundation/Foundation.h>intMainintargcConst Char*argv[]) {FILE* FP1;//define file pointers for reading files Char* FP2;//to determine if the lyrics are finished . Chars[ the];//Staging Lyrics Long intTime2=0; Long intTime=0;//used to calculate the time, the accuracy of seconds, not perfect, looking at the expert pointing intA=1;//play a role in judgingFp1=fopen ("/users/qingyun/desktop/Chase Dream Eisenia foetida Heart. LRC","R");//read-only open, path can be defined by macroFgets (s), +, FP1); //in order to output the song name while(a) {a++; if(s[a]==']') { Break; }} S[a]=' /'; printf ("Song name:%s\n", &s[3]); Sleep (3); Fgets (s), +, FP1); //in order to output the singer nameA=1; while(a) {a++; if(s[a]==']') { Break; }} S[a]=' /'; printf ("Singer:%s\n", &s[3]); Sleep (3); Fgets (s), +, FP1); //because some lyrics have other properties, for compatibility only output song name and singer name, followed by lyrics while(s[1]!='0') {fgets (s), +, FP1); } while(Fp2!=null)//Judging if the lyrics are finished reading{ Time= (s[1]-'0')*60000+ (s[2]-'0')*6000+ (s[4]-'0')* ++ (s[5]-'0')* -+ (s[7]-'0')*Ten+ (s[8]-'0')*1; printf ("%s", &s[Ten]); while(time>time2) {Sleep (1); Time2+= -; } FP2=fgets (s), +, FP1); } fclose (FP1);//Close File return 0;}
Objective-c Lyrics Analysis