SHARE
TWEET

Task02Illuminati

g-stoyanov Apr 14th, 2014 202 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace Task02Illuminati
  2. {
  3.     using System;
  4.  
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             string message = Console.ReadLine().ToUpper();
  10.             int count = 0;
  11.             int result = 0;
  12.             for (int i = 0; i < message.Length; i++)
  13.             {
  14.                 if ((int)message[i]  == 65 ||
  15.                     (int)message[i] == 69 ||
  16.                     (int)message[i] == 73 ||
  17.                     (int)message[i] == 79 ||
  18.                     (int)message[i] == 85)
  19.                 {
  20.                     result += (int)message[i];
  21.                     count++;
  22.                 }
  23.                
  24.             }
  25.  
  26.             Console.WriteLine("{0}\n{1}", count, result);
  27.         }
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top