Объяснение:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace example
{
class Program
{
static void Main(string[] args)
{
int x, answer1, answer2;
Console.Write("Введите x : ");
x = int.Parse(Console.ReadLine());
answer1 = 2*x+3*Convert.ToInt32(Math.Pow(x,2))-4*Convert.ToInt32(Math.Pow(x,3));
answer2 = 1+2*x+3*Convert.ToInt32(Math.Pow(x,2))+4*Convert.ToInt32(Math.Pow(x,3));
Console.WriteLine("Значение первого выражения : " + answer1);
Console.WriteLine("Значение второго выражения : " + answer2);
Console.ReadLine();
}
}
}
Поделитесь своими знаниями, ответьте на вопрос:
Дан одномерный числовой массив. вычислить в какой позиции массива встретилось число со значением a.
M,B:array[1..nx] of integer;
begin
Randomize;
write('Введите число элементов массива n'); Read(n);
write('Введите число а '); Read(a);
for i:=1 to n do begin
M[i]:= random(10)-5;
if M[i] = a then begin j:=j+1;B[j]:=i;end;
write(M[i]:3);end;writeln;
for i:=1 to j do
writeln('Элемент массива совпадает а = ' ,a, ' на позиции ', B[i]);end.