Нужна с блок-схемами! Алгоритм есть, просто сделайте для меня блок-схему! Задание №1.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LabWork2._1
{
class MainClass
{
static double CalcIteration(double x, int n) => 1 / (n * Math.Pow(x, n));
public static void Main()
{
double current, f = 2.0, x = 3;
int n = 1;
do
{
current = CalcIteration(x, n);
f += current;
n += 2;
Console.WriteLine(current);
}
while (Math.Abs(current) > 0.0001);
Console.ReadLine();
}
}
}
Задание №2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LabWork2_2
{
using System;
public class Program
{
public static void Main()
{
var rand = new Random();
int x = rand.Next(3, 10);
int t = 1200;
int count;
if (t % x == 0)
{
count = t / x;
}
else
{
count = t / x + 1;
}
int ans;
if (count % 20 == 0)
{
ans = count / 20;
}
else
{
ans = count / 20 + 1;
}
Console.WriteLine("ответом будет:");
Console.WriteLine(ans.ToString());
Console.ReadLine();
}
}
}
241
438
Ответы на вопрос:
[0] => 7
[1] => 8
[2] => 9
[3] => 10
[4] => 11
[5] => 7
[6] => 16
[7] => 18
[8] => 20
[9] => 22
[10] => 24
Сделал на php выдало такой результат
Популярно: Информатика
-
samnsk10061717.01.2022 16:11
-
НикитаПахомов131.07.2022 08:21
-
Turalinin07.04.2021 20:59
-
Qwesyukir09.11.2022 15:57
-
ksenia2006211.01.2020 05:34
-
gallavich200425.08.2020 04:28
-
Dashboard1822824.04.2021 08:17
-
themartynov2315.06.2023 21:24
-
RinOkumura9909.04.2023 22:24
-
Racamaxa06.12.2022 11:01