Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int ch = 0, wd = 1;
- string st = Console.ReadLine();
- while (st != "")
- {
- if (st[0] == ' ')
- {
- wd++;
- }
- else
- {
- ch++;
- }
- st = st.Remove(0,1);
- }
- Console.WriteLine("Букв: {0}\nСлов: {1}",ch, wd);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment