stanevplamen

03.01.01.BitwisePasswords

Jul 1st, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. class BitwisePasswords
  4. {
  5.     static void Main()
  6.     {
  7.         int counter = 0;
  8.         string input = Console.ReadLine(); //"***101***";
  9.         for (int i = 0; i < input.Length; i++)
  10.         {
  11.             if (input[i] == '*')
  12.             {
  13.                 counter++;
  14.             }
  15.         }
  16.         long l = (long)Math.Pow(2, counter);
  17.         Console.WriteLine(l);
  18.     }
  19. }
Add Comment
Please, Sign In to add comment