Иван1764
?>

Переведите. 1/2 гигобайта = 1/4 байта = 1/8 килобайта = 1/2 теробайта =

Информатика

Ответы

Новицкий1107
1/2 гб = 536 870 912 байт
1/4 байта = 2 бит
1/8 кб = очень мало тб (возможно, в задании ошибка)
1/2 тб = 524288 мб
Chistov9721209

Задание 1:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

#include <ctime>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

 

int N = rand() % 6 + 5;

int pos = 0, neg = 0, max = -20, min = 20, maxind, minind;

int* mass = new int[N];

cout << "Массив:" << endl;

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

 mass[i] = rand() % 41 - 20;

 if (mass[i] > 0) pos++;

 if (mass[i] < 0) neg++;

 if (mass[i] > max) {

  max = mass[i];

  maxind = i;

 }

 if (mass[i] < min) {

  min = mass[i];

  minind = i;

 }

 cout << setw(3) << mass[i];

}

cout << endl << endl;

if (pos > neg) {

 swap(mass[maxind], mass[minind]);

 cout << "Измененный массив:" << endl;

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

  cout << setw(3) << mass[i];

 }

}

else cout << "Массив не изменился";

cout << endl;

 

delete[] mass;

system("pause");

return 0;

}

Задание 2:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

#include <ctime>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

 

int N = rand() % 6 + 5;

int max = -20, min = 20, maxind, minind;

int* mass = new int[N];

cout << "Массив:" << endl;

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

 mass[i] = rand() % 41 - 20;

 if (mass[i] > max) {

  max = mass[i];

  maxind = i;

 }

 if (mass[i] < min) {

  min = mass[i];

  minind = i;

 }

 cout << setw(3) << mass[i];

}

cout << endl << endl;

if (abs(minind - maxind) == 1) {

 cout << "Измененный массив:" << endl;

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

  if (mass[i] < 0) mass[i] = 0;

  cout << setw(3) << mass[i];

 }

}

else cout << "Массив не изменился";

cout << endl;

 

delete[] mass;

system("pause");

return 0;

}

tyrenumberone

<!DOCTYPE html>

<html lang="en">

<head>

   <meta charset="utf-8">

   <style type="text/css">

       #circle {

           border-radius: 100px;

           width: 100px;

           height: 100px;

           position: absolute;

           top: 50%;

           left: 50%;

           transform: translate(-50%, -50%);

           cursor: pointer;

       }

       #circle.red {

           background-color: red;

       }

       #circle.green {

           background-color: green;

       }

       #circle.orange {

           background-color: orange;

       }

   </style>

   <title>Title</title>

</head>

<body>

<div id="circle" class="red"></div>

<скрипт>

   colors = ["red", "green", "orange"]

   document.getElementById("circle").addEventListener("click", function(e) {

       const element = this;

       let currentColor = element.classList.value

       if (currentColor === "orange"){

           currentColor = colors[0]

       } else {

           currentColor = colors[colors.indexOf(currentColor)+1]

       }

       element.classList = currentColor

   })

</скрипт>

</body>

</html>

P.S. При загрузке фулл кода выдает ошибку от сайта.. Поэтому на фотке весь код


создайте страничку с красным кружком (100х100) и напишите скрипт который будет при каждом клике на к

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Переведите. 1/2 гигобайта = 1/4 байта = 1/8 килобайта = 1/2 теробайта =
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Татьяна Гришаевич
Evagg3856
superkiosk249
Наталья
stomcom01
Elen-Fler
moscow053988
Овезова Игорь
evatautes
Zaikinarusina
Евгений1286
Irinagarmonshikova
ibswoklol1362
grebish2002
Varagyant