goldin1337
22.03.2022 12:09

мне как эту вопрос разрешит ​


мне как эту вопрос разрешит ​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
KatyaDihtiar3112
19.07.2020 07:33
Var  
i, j, k : integer; 
 a : array [0..9,0..9] of char; 
procedure U(i,j:integer);  
var c : char; 
begin 
 c:=a[i,j]; a[i,j]:=' ';  
if (c='W')and(a[i+1,j]='B') then U(i+1,j);
  if (c='B')and(a[i+1,j]='W') then U(i+1,j); 
 if (c='W')and(a[i-1,j]='B') then U(i-1,j); 
 if (c='B')and(a[i-1,j]='W') then U(i-1,j); 
 if (c='W')and(a[i,j+1]='B') then U(i,j+1);  
if (c='B')and(a[i,j+1]='W') then U(i,j+1); 
 if (c='W')and(a[i,j-1]='B') then U(i,j-1); 
 if (c='B')and(a[i,j-1]='W') then U(i,j-1); 
end; 
begin  
assign(input,'input.txt');
reset(input); 
 assign(output,'output.txt');
 rewrite(output);  
for i:=1 to 8 do begin  for j:=1 to 8 do
 read(a[i,j]); 
 readln  
end;  
for i:=1 to 8 do
 begin 
 a[0,i]:=' '; a[9,i]:=' ';  a[i,0]:=' '; a[i,9]:=' '  
end; 
 k:=0; 
 for i:=1 to 8 do 
 for j:=1 to 8 do 
 if a[i,j]<>' ' then
begin 
 k:=k+1; U(i,j)  
end;  
write(k); 
 close(output) 
end. 
0,0(0 оценок)
Ответ:
05061972
10.03.2020 08:11
#include <iostream>
#include <cstdlib>#include <ctime>
using namespace std;

int main() {
srand(time(0));
const int n = 5;
int x[n], y[n], x0=0, y0=0;
for (int i = 0; i < n; ++i) {
x[i] = rand() % 5;
y[i] = rand() % 5;}
for (int i = 0; i < n; ++i) {
cout<< x[i]<<' ';}
cout << endl;
for (int i = 0; i < n; ++i) {cout << y[i] << ' ';}
for (int i = 0; i < n; ++i) {
if (x[i]) x0++;
if (y[i]) y0++;}
cout << endl;
if (x0 > y0) cout << 'x';
if (x0 < y0) cout << 'y';
if (x0 == y0) cout << '='; 
return 0;}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота