can any one help me in my code ,he didn't work in my bc
//have be the input is (abababaaaaaab) //and the resolt is "Right" #include <stdio.h> #include <stdlib.h> #include <string.h> int longer(char phr[50],int i){ if(phr[i]=='\0'){ return 0; }else{ return longer(phr,i+1)+1;}} int occurrence(char phe[],char a){ int k=0; for(int i=0;i<=longer(phe,0);i++){ if(phe[i]==a){ k=k+1; }}return k;} int longage2(char phe[ ]){ if (strlen(phe)==1||strlen(phe)%2!=0||phe[strlen(phe)]=='a'){ return 0; } for(int i=0;i<strlen(phe);i++){ if(i%2==0){ if(phe[i]!='a'){ return 0; }}else{ if(phe[i]!='b'){ return 0;}} }return 1;} int longage3(char phe[]){ int a=occurrence(phe,'a'); if(occurrence(phe,'a')%2!=0){ return 0;} else{ for(int i=0;i<occurrence(phe,'a');i++){ if(phe[i]!='a'){ return 0; }} if(occurrence(phe,'b')==0){ return 0; }} return 1;} int longage4(char phe[]){ int a,k,j;char ph1[30]; if(phe[0]!='a'){ //||occurrence(phe,'a')<3 || occurrence(phe,'b')<2 return 0; }else{ for( int i=0;i<=longer(phe,0)-1;i++){ ph1[i]=phe[i]; if(longage2(ph1)==1){ a=i; }} if(a<1){ return 0; } char ph2[a+2]; for(int j=0;j<=a;j++){ ph2[j]=ph1[j]; } ph2[a+1]='\0'; //------------------------------------ char ph3[longer(phe,0)-(a+2)+1]; for (int o=a+1;o<=strlen(phe);o++){ ph3[k]=phe[o]; //printf("%d\n",longage3(ph3)); k=k+1; } ph3[strlen(ph3)+1]=='\0'; if(longage2(ph2)==1 &&longage3(ph3)==1){ return 1; }else{ return 0; }}} int main() {char phe[50]; printf("donnez un mot\n"); scanf("%s",phe); if (longage4(phe)==1){ printf("Right"); }else{ printf("Wrong");} return 0; }