Перевести программу с языка C# на C++:

using System;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
var m = 5;
var k = 8;
var result = Sum(m) + Sum(2 * k);
Console.WriteLine(result);
Console.ReadKey();
}
static int Sum(int n, int a = 0)
{
if (n-- == 0) return a;
return Sum(n, 1 + a + n);
}
}
}
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.