М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
Vova77723
Vova77723
06.12.2020 14:37 •  Информатика

1. задан массив d. определить следующие суммы: d[1] + d[2] + d[3]; d[3] +d[4] +d[5]; d[4] + d[5] + d[6], используя подпрограмму для вычисления суммы трех последовательно расположенных элементов массива.

👇
Ответ:
SoFiA5454555
SoFiA5454555
06.12.2020
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cstring>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <climits>typedef unsigned long long ulol;
typedef long long lol;
typedef long int  li;#define mp          make_pair
#define F           first
#define S           second
#define sqr(a)      ( (a) * (a) )
#define pb          push_back
#define INF         999999999
#define ret(a)      cout << endl; system("pause"); return(a)
//#define ret(a)      return(a)using namespace std;int main()
{
    lol n;
    cin >> n;
    vector<lol> ar(n);
    for(int i = 0 ; i < n ; i ++)
        cin >> ar[i];
    for(int i = 0 ; i < n ; i += 3)
        cout << i+1 << '-' << i+3 << ": " << ar[i]+ar[i+1]+ar[i+2] << endl;
    ret(0);
}
4,5(84 оценок)
Открыть все ответы
Ответ:
Dasha292001
Dasha292001
06.12.2020

a = int(input())

for i in range(a):

 b = input()

 c = 0

 d = True

 e = 0

 f = False

 g = False

 h = '\''

 for j in b:

   if j == '#' and not f:

     g = True

     break

   elif j != ' ':

     if d:

       print(' ' * c, end='')

     elif c > 0:

       print(' ', end='')

     c = 0

     print(j, end='')

     if(j == '\"' or j == '\'') and e % 2 == 0:

       if f and j == h:

         f = False

       else:

         f = True

         h = j

     if f:

       d = True

     else:

       d = False

     if j == '\\':

       e += 1

     else:

       e = 0

   else:

     c += 1

   r = j == ' '

if g and c > 1:

 print(' ', end='')

if i < a - 1:

 print()

1

Объяснение:

4,7(99 оценок)
Ответ:
sashaageev04
sashaageev04
06.12.2020
var a, b, c, D, x, y: real;
begin
 readln(a, b, c); {ax^4 + bx^2 + c = 0}
 if a = 0 then
 writeln('Non-bisquare')
 else
 begin
  D := b * b - 4 * a * c;
  if D < 0 then
  writeln('No solutions')
  else
  begin if D = 0 then
   begin x := -b / 2 / a;
    if x < 0 then
     writeln('No solutions')
    else writeln('2 solutions: ', sqrt(x), ' ', -sqrt(x));
   end
   else
   begin x := (-b + sqrt(D)) / 2 / a;
    y := (-b - sqrt(D)) / 2 / a;
    if x < 0 then writeln('No solutions');
    if x = 0 then
     writeln('1 solution: 0');
    if (x > 0) and (y < 0) then
     writeln('2 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3);
    if (x > 0) and (y = 0) then
     writeln('3 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' 0');
    if y > 0 then
     writeln('4 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' ', sqrt(y):0:3, ' ', -sqrt(y):0:3);
   end;
  end;
 end;
end.
4,5(6 оценок)
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ