Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Lecture
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- int Size = int.Parse(Console.ReadLine ());
- string Text = Console.ReadLine ();
- int WhiteSum = 0;
- int BlackSum = 0;
- Size = Size * Size;
- for (int i = 0; i < Size; i++) {
- if (Text.Length != i) {
- if (i % 2 == 0) {
- WhiteSum = WhiteSum + Text [i];
- } else {
- BlackSum = BlackSum + Text [i];
- }
- }
- }
- Console.WriteLine ("{0} white",WhiteSum);
- Console.WriteLine ("{0} Black",BlackSum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement