Advertisement
Gillito

Untitled

Jun 4th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication30
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int count = 0;
  14.             string str = Console.ReadLine();
  15.             //int found = str.IndexOf('.');
  16.             //Console.WriteLine(str.IndexOf('.'));
  17.             //Console.WriteLine(str.LastIndexOf('.'));
  18.  
  19.             for (int i = str.IndexOf('.') + 1; i < str.LastIndexOf('.'); i++)
  20.                 count++;
  21.             Console.WriteLine(count);
  22.             Console.ReadLine();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement