Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace App1
- {
- class PrintLongSequence
- {
- static void Main()
- {
- for (short i = 2; i <= 1001; i++)
- {
- bool isMaxVal = (i != 1001);
- if (i % 2 == 0)
- {
- Console.Write(i + ",");
- }
- else
- {
- Console.Write(((-1) * i) + ((isMaxVal) ? "," : "\n"));
- };
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement