getchar(); c=getchar(); while(c!='\n') { if(c==' ') {Max=max(Max,p);p=0;} else if(c>='A'&&c<='Z')p++; c=getchar(); }