#include <iostream>
using namespace std;
int main(){
unsigned short int Picture[4][4];
unsigned short int AverageBrightness = 0;
for(unsigned short int y = 0;y < 4;y++){
for(unsigned short int x = 0;x < 4;x++){
std::cin >> Picture[y][x];
AverageBrightness = AverageBrightness + Picture[y][x];
}
}
AverageBrightness = AverageBrightness / 16;
for(unsigned short int y = 0;y < 4;y++){
for(unsigned short int x = 0;x < 4;x++){
if(Picture[y][x] < AverageBrightness){
Picture[y][x] = 0;
}else{
Picture[y][x] = 255;
}
}
}
for(unsigned short int y = 0;y < 4;y++){
for(unsigned short int x = 0;x < 4;x++){
std::cout << Picture[y][x];
}
}
return 0;
}
Объяснение:
Using System;
namespace chislaabc
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine(“Введите число a”);
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число b”);
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число c”);
c = Convert.ToInt32(Console.ReadLine());
if (a == b || a == c || b == c)
{
Console.WriteLine(«Есть хотя бы одна противоположная пара»);
}
else
{
Console.WriteLine(«Противоположных чисел нет»);
}
Console.ReadKey();
}
}
}
Объяснение:
Десятичная: 01
Двоичная: 1010
Восьмеричная: 10
Шестнадцатеричная: 8