Ввести у циклі n символів. Використовуючи клас Char, визначити, чого в масиві більше – літер чи чисел. Повторити ці дії на рядку (за умовчанням він є масивом символів С#
Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { double sum = 0; int N=50; for (int i = 1; i <= N; i++) sum += 1 / Math.Pow(i, 3); Console.WriteLine("Сумма = " + sum); Console.ReadKey(); } } }
oksana77768
27.04.2023
Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { double sum = 0; int N=50; for (int i = 1; i <= N; i++) sum += 1 / Math.Pow(i, 3); Console.WriteLine("Сумма = " + sum); Console.ReadKey(); } } }
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Ввести у циклі n символів. Використовуючи клас Char, визначити, чого в масиві більше – літер чи чисел. Повторити ці дії на рядку (за умовчанням він є масивом символів С#
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double sum = 0;
int N=50;
for (int i = 1; i <= N; i++)
sum += 1 / Math.Pow(i, 3);
Console.WriteLine("Сумма = " + sum);
Console.ReadKey();
}
}
}