Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace S4
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Type a string, it must end with an asterisk");
- string St = Console.ReadLine();
- if (St[St.Length - 1] != '*')
- {
- Console.WriteLine("Invalid string! It didn't end with an asterisk");
- }
- else
- {
- int[] Counter = new int[St.Length];
- for (int i = 0; i < St.Length; ++i)
- {
- if (St[i] >= 'a'&&St[i]<='z')
- {
- Counter[i] = 1;
- }
- }
- int az = 0;
- for (int i = 0; i < Counter.Length; ++i)
- {
- if (Counter[i] == 1)
- { ++az; }
- }
- Console.WriteLine("There are {0} small English letters in this string", az);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment