Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rextester.Program.Main is the entry point for your code. Don't change it.
- //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- string input;
- List<string> s = new List<string>();
- while((input = Console.ReadLine()) != null ){
- s.Add(input);
- }
- int uk = 0;
- int maks = 0;
- int res = 0;
- int koji = 0;
- int ind = 0;
- foreach(string h in s){
- bool b1 = String.IsNullOrWhiteSpace(h);
- if(b1)continue;
- ind++;
- string pom = h;
- int duz = pom.Length;
- int pravaduz = 0;
- int last = -1;
- bool los = false;
- for(int i=0; i<duz; i++){
- if(Char.IsWhiteSpace(pom[i])){
- continue;
- }
- pravaduz++;
- if(last == -1){
- if(pom[i] >= 'a' && pom[i] <= 'z'){
- last = 0;
- }
- else if(pom[i] >= 'A' && pom[i] <= 'Z'){
- last = 1;
- }
- else{
- los = true;
- break;
- }
- }
- else{
- int tr = 0;
- if(pom[i] >= 'a' && pom[i] <= 'z'){
- tr = 0;
- }
- else if(pom[i] >= 'A' && pom[i] <= 'Z'){
- tr = 1;
- }
- else{
- los = true;
- break;
- }
- if(tr == last){los = true; break;}
- last = tr;
- }
- }
- if(los == false){
- res++;
- maks = Math.Max(pravaduz,maks);
- }
- continue;
- }
- Console.WriteLine(res);
- Console.WriteLine(maks);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement