Determine the length of the maximal series of characters other than the letters c



The author posted a question in Programming

Determine the length of the maximal series of characters other than the letters c and got a better answer

Response from

Response from 0[+++++]
int cnt= 0, max= 0; foreach char c in text { if char.IsLetter c cnt= 0; else cnt++; if max < cnt max= cnt; } Console.WriteLine max ;

 

To answer the question:

Name*

E-mail:*

Reply text:*
Verification code (enter 22):*