using System;
namespace ConsoleApp4
{
class Program
static void Main(string[] args)
Console.WriteLine("Введите n: ");
double equal1 = 0;
double equal2 = 0;
int i1 = 1;
int n = Int32.Parse(Console.ReadLine());
for(int i = 1; i <= n; i++) {
equal1 += Math.Pow(-1, i);
Console.Write(Math.Pow(-1, i) + " ");
}
Console.Write("equal1 = ");
Console.WriteLine(equal1);
while (i1 <= n) {
equal2 += Math.Pow(-1, i1);
Console.Write(Math.Pow(-1, i1) + " ");
i1++;
Console.Write("equal2 = ");
Console.WriteLine(equal2);
using System;
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите n: ");
double equal1 = 0;
double equal2 = 0;
int i1 = 1;
int n = Int32.Parse(Console.ReadLine());
for(int i = 1; i <= n; i++) {
equal1 += Math.Pow(-1, i);
Console.Write(Math.Pow(-1, i) + " ");
}
Console.Write("equal1 = ");
Console.WriteLine(equal1);
while (i1 <= n) {
equal2 += Math.Pow(-1, i1);
Console.Write(Math.Pow(-1, i1) + " ");
i1++;
}
Console.Write("equal2 = ");
Console.WriteLine(equal2);
}
}
}