psotirov

Task 9

Oct 29th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.27 KB | None | 0 0
  1. using System;
  2.  
  3. class PrintNumberSequence
  4. {
  5.     static void Main()
  6.     {
  7.         for (int i=1; i<11; i++)
  8.         {
  9.             if (i > 1) Console.Write(", ");
  10.             Console.Write("{0}", (i%2>0)?i+1:-i-1);
  11.         }
  12.         Console.WriteLine();
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment