Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace PrintASequence
- {
- class PrintASequence
- {
- static void Main()
- {
- for (short i = 2; i < 12; i++)
- {
- if (i % 2 == 0)
- {
- Console.Write(i + ","); // четни числа
- }
- else
- {
- Console.Write((-i) + ","); // нечетни числа
- }
- }
- }
- }
- }
- // Console Output: 2,-3,4,-5,6,-7,8,-9,10,-11,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement