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

Составьте сами диаграмму Венны на слова Источник и Приёмник​

👇
Ответ:
Маргарин11
Маргарин11
27.05.2023

Объяснение:

Рисуешь два круга так, чтобы они пересекали друг друга в двух точках

левая часть круга (1круг)-Источник

правая часть(2 круг) - Приëмник

центр (область пересечения двух кругов, овал) - Источник И Приëмник

4,4(51 оценок)
Открыть все ответы
Ответ:
Coolplay
Coolplay
27.05.2023

#include <stdlib.h>

#include <time.h>

#include <iostream>

using namespace std;

#define N 16

void main()

{

   int randomNumbers[N];

   srand(time(NULL));

   for (int i = 0;i < N; i++)

   {

       randomNumbers[i] = rand() % 40 - 20;

       cout << "randomNumber[" << i << "] = " << randomNumbers[i] << endl;

   }

   cout << endl;

   int counter = 0;

   for (int i = 0; i < N; i++)

   {

       if (randomNumbers[i] < 0)

       {

           counter++;

       }

   }

   cout << "counter = " << counter << endl;

}

4,4(43 оценок)
Ответ:
erzhankenzhekan
erzhankenzhekan
27.05.2023

using System;

using System.Collections.Generic;

using System.Text;

namespace MyQueue

{

   public class QueueException : Exception { }

   public class Queue <T>

   {

       private const int _basicCapacity = 8;

       private int _capacity;

       private int _count;

       private T[] _items;

       private int _begin;

       private int _end;

       

       public int Capacity

       {

           get => _capacity;

           protected set

           {

               int newCapacity = value;

               T[] newItems = new T[newCapacity];

               Count = Math.Min(Count, Capacity);

               for (int i = 0; i < Count; i++)

               {  

                   newItems[i] = _items[(_begin + i) % Capacity];

               }

               _begin = 0;

               _end = Count;

               _items = newItems;

               _capacity = newCapacity;

           }

       }

       

       public int Count

       {

           get => _count;

           protected set => _count = value;

       }

       

       public Queue()

       {

           Capacity = _basicCapacity;

           Count = 0;

           _begin = 0;

           _end = 0;

           _items = new T[Capacity];

       }

       

       public void Enqueue(T item)

       {

           if (Count == Capacity)

           {

               Capacity *= 2;

           }

           Count++;

           _items[_end] = item;

           _end = (_end+1) % Capacity;

       }

       

       public bool IsEmpty()

       {

           return Count == 0;

       }

       

       public T Dequeue()

       {

           if (IsEmpty())

           {

               throw new QueueException();

           }

           T item = _items[_begin];

           _begin = (_begin+1) % Capacity;

           Count--;

           if (Count * 4 < Capacity)

           {

               int newCapacity = Math.Max(Capacity / 4, _basicCapacity);

               if (newCapacity < Capacity)

               {

                   Capacity = newCapacity;

               }

           }

           return item;

       }

       

       public T Peek()

       {

           if (IsEmpty())

           {

               throw new QueueException();

           }

           return _items[_begin];

       }

       

       public override string ToString()

       {

           StringBuilder sb = new StringBuilder();

           for(int i = 0; i < Count; i++){

               if (i > 0)

               {

                   sb.Append(" ");

               }

               sb.Append(_items[(_begin+i) % Capacity].ToString());

           }

           return sb.ToString();

       }

       

       public void Clear()

       {

           Count = 0;

           _begin = 0;

           _end = 0;

           if (Capacity > _basicCapacity)

           {

               Capacity = _basicCapacity;

           }

       }

   }

   

   class Program

   {

       public static void Main (string[] args)

       {

           Queue <double> q = new Queue <double>();

           for(int i = 0; i < 20; i++){

               q.Enqueue(i);

           }

           Console.WriteLine("0-19: \"{0}\"", q.ToString());

           for(int i = 0; i < 10; i++)

           {

               Console.WriteLine("Peek: {0}", q.Peek());

               Console.WriteLine("Dequeue: {0}", q.Dequeue());

           }

           Console.WriteLine("10-19: \"{0}\"", q.ToString());

           q.Clear();

           Console.WriteLine("Empty queue representation: \"{0}\"", q.ToString());

           Console.WriteLine("Queue is empty? {0}", q.IsEmpty());

       }

   }

}

Объяснение:

Реализация циклической очереди с примерами использования.

Тот же самый код тут: onlinegdb.com/SkyJfEvnS

4,7(89 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ