gogoged
19.11.2021 12:17

Составьте программу ввода с клавиатуры массива целых чисел a и вычисление суммы массива

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Melentii
25.09.2021 06:18

Часть 1

1.

a, b, c, d = int(input()), int(input()), int(input()), int(input())

s = (a + b + c + d)/4

print(s)

2.

x, y = int(input()), int(input())

t = x

x = y

y = t

print(x, y, sep = "\n")

4.

from math import pi

L, D = float(input()), float(input())

R = (L - D) / (2 * pi)

print(R)

5.

from math import pi

R1, R2 = float(input()), float(input())

r = R1**2 - R2**2

S = pi * r

print(S)

6.

x, y = int(input()), int(input())

S = (2*x - y)*(x - y)

print(S)

Часть 2

1.

x, y = float(input()), float(input())

x, y = y, x

print(x, y)

2.

если нужно найти y = x * 5:

x = int(input())

y = x * 5

print(y)

если нужно найти y = x^{2}:

x = int(input())

y = x ** 5

print(y)

3.

x = int(input())

y = 1 - 2*x + 3*x**2 - 4*x**3

print(y)

4.

x1, y1, x2, y2 = float(input()), float(input()), float(input()), float(input())

from math import sqrt

S = sqrt((x1 - x2)**2 + (y1 - y2)**2)

print(S)

0,0(0 оценок)
Ответ:
помогите1165
04.04.2023 22:25
//Dev-C++ 4.9.9.2

#include <iostream>
#include <ctime>
using namespace std;

int main(){
    srand(time(NULL));
    int ma[5][10];
    int maxn=0;
    double s=0;
    double max=-2147483647;
    for(int i=0;i<10;i++)
     for(int j=0;j<5;j++)
      ma[i][j]=rand()%2;
    for(int j=0;j<5;j++){
     for(int i=0;i<10;i++)
      s=s+ma[i][j];
     if(s>max){max=s; maxn=j;}
     s=0;}
    cout<<"Matrix"<<endl;
    for(int i=0;i<10;i++){
     for(int j=0;j<5;j++)
      cout<<ma[i][j]<<" ";
     cout<<endl;}
    cout<<maxn+1;
    cin.get();
    cin.get();
  return 0;
    }

Нужна ! ( программа с++) с датчика случайных чисел заполнить двоичную матрицу 5х10. определить номер
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота