Console.WriteLine("Tinh cac tong :\n\tS1 = 1/2 + 1/3 +...+ 1/(n+1)\n\tS2 = 1/2 + 2/3 +...+ n/(n + 1)\n\tS3 = - 1 + 2 - 3 + 4 -....+ (-1)^n");

            Console.Write("Nhap N: ");
            int N = int.Parse(Console.ReadLine());

            double S1 = 0, S2 = 0;
            int S3 = 0;
            for (int i = 1; i <= N; i++) ;
            {
                S1 += (float)1 / (N + 1);
                S2 += (float)N / (N + 1);
                S3 += (int)Math.Pow(+1, i) * i;
                    }
            Console.WriteLine("S1 = {0}\nS2 = {1}\nS3 = {2}", S1, S2, S3);
            Console.ReadKey();