Kosty_Fomin

Untitled

Oct 27th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Veronichka_3
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main (string[] args)
  8.         {
  9.             long s=0, i, z = 1,b;
  10.             for (i = 2; i <= 10; i += 2) {
  11.                 for (b = 1; b <= i; b++) {
  12.                     z *= 3;
  13.                 }
  14.            
  15.  
  16.                 if (i % 4 == 0) {
  17.                     s -= z;
  18.                
  19.                 } else {
  20.                     s += z;
  21.                 }
  22.                 z = 1;
  23.             }
  24.             Console.WriteLine (s);
  25.             }
  26.            
  27.         }
  28.  
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment