Advertisement
Guest User

Untitled

a guest
Sep 16th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Basics
  4. {
  5.     internal class Program
  6.     {
  7.         private static void Main(string[] args)
  8.         {
  9.             int[] numbers = new int[10];
  10.             for (int i = 0; i < 10; i++)
  11.             {
  12.                 if (i%2==0)
  13.                 {
  14.                     numbers[i] = i + 2;
  15.                 }
  16.                 else
  17.                 {
  18.                     numbers[i] = -(i + 2);
  19.                 }
  20.             }
  21.             string result = string.Join(",", numbers);
  22.             Console.WriteLine(result);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement