[an error occurred while processing this directive]
ошибка в сравнении if (cur>max)max=cur ? какая точность сравнения?