#include #include FILE *in; FILE *out; typedef struct para_typ{ unsigned int x,y; }PARA; PARA sold[8001]; char sherenga[10000]; unsigned int count; int c,p_end; int /*check=0,*/check2=0; int main(void) { in=fopen("input.txt","r"); out=fopen("output.txt","w"); fscanf(in,"%s",sherenga); /* check=0;*/ while(1) /*check!=1*/ { for(c=0;c' && sherenga[c+1]=='<') { p_end++; sold[p_end].x=c; sold[p_end].y=c+1; count++; } } if(check2==count) { // check=1; fprintf(out,"%d",count); fclose(in); fclose(out); return 0; } if(check2!=count) { for(c=0;c<=p_end;c++) { sherenga[sold[c].x]='<'; sherenga[sold[c].y]='>'; } check2=count; } } }