KsyLisa
26.04.2021 17:36

Найти ошибки вот : #include #include #include #include #include int main() { int chislo_slov; //число слов int dlia_vvoda_chisla_slov; for(dlia_vvoda_chisla_slov=0; dlia_vvoda_chisla_slov< 1; ){ printf("vvedite chislo slov: "); scanf("%d",& chislo_slov); if (chislo_slov< = 10000 and chislo_slov> =2){ printf("chislo slov: %d\n",chislo_slov); //кол-во строк printf("vvedite slova cherez enter: "); dlia_vvoda_chisla_slov++; } else printf("povtorite popitku\n"); } char **massiv_vvodimih_slov=(char**)malloc(chislo_slov*sizeof(char)); for (int i=0; i massiv_vvodimih_slov[i]=(char*)malloc(100*sizeof(char)); for(int i=0; i char *vvodimoe_slovo; vvodimoe_slovo = (char*)malloc(100 * sizeof(char)); scanf("%s",vvodimoe_slovo ); *massiv_vvodimih_slov[i]=*vvodimoe_slovo; } int vse_slova; int rifma1=0; int rifma2=0; int pervoe_slovo=0; int vtoroe_slovo=0; char **massiv_vivoda; *massiv_vivoda = (char *)malloc(2 * sizeof(char)); for(int z=0; z< 2; z++) massiv_vivoda[z]=(char*)malloc(1000*sizeof(char)); for( vse_slova=0,vtoroe_slovo=0,pervoe_slovo=0; vse_slova { if(vtoroe_slovo { int slovo1=strlen(massiv_vvodimih_slov[pervoe_slovo]); int slovo2=strlen(massiv_vvodimih_slov[vtoroe_slovo]); if(pervoe_slovo! =vtoroe_slovo){ for(int g=0,p=1,y=slovo1-p,i=slovo2-p; g==0 and y> =0 and i> =0; ){ if(massiv_vvodimih_slov[pervoe_slovo][y]==massiv_vvodimih_slov[vtoroe_slovo][i]){ rifma1++; p++; } else{ if(rifma1> rifma2){ rifma2=rifma1; rifma1=0; *massiv_vivoda[0]=*massiv_vvodimih_slov[pervoe_slovo]; *massiv_vivoda[1]=*massiv_vvodimih_slov[vtoroe_slovo]; } else{ g++; vse_slova++; else vtoroe_slovo++; } else{ vtoroe_slovo=0; pervoe_slovo++; } } int m=0; if(rifma2==0) printf("u slov net rifmi"); else{ printf("dlinna rifmi: %d,\n",rifma2); printf("u slov %s i %s",massiv_vivoda[m],massiv_vivoda[m+1]); } }

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
domofon98
05.01.2021 03:00

Задание 1

#include <iostream>

using namespace std;

int main() {

int a, b;

cin >> a >> b;

cout << a - b;

}

Задание 2

#include <iostream>

#include <math.h>

using namespace std;

int main() {

int a;

cin >> a;

cout << pow(a, 2) << ' ' << pow(a, 3)<< ' ' << pow(a, 5);

}

Задание 3

#include <iostream>

#include <math.h>

using namespace std;

int main() {

int a;

cin >> a;

cout << "The next number for the number " << a << " is " << a + 1 <<"!\n" <<"The previous number for the number "<< a << " is " << a - 1 <<"!";

}

Задание 4

#include <iostream>

#include <math.h>

using namespace std;

int main() {

int a;

cin >> a;

cout << (3 * pow(a, 3) + 18 * pow(a, 2)) * a + 12 * pow(a, 2) - 5;

}

Задание 5

#include <iostream>

#include <math.h>

using namespace std;

int main() {

int a, b, c;

cin >> a >> b >> c;

cout << a % 7 << "\n" << b % 7 << "\n" << c % 7;

}

Задание 6

#include <iostream>

#include <math.h>

using namespace std;

int main() {

int a, b, c, a1, b1, c1;

cin >> a >> a1 >> b >> b1 >> c >> c1;

cout << a1 % (8 - a) << "\n" << b1 % (8 - b) << "\n" << c1 % (8 - c);

}

0,0(0 оценок)
Ответ:
АБН2014
16.02.2022 16:26
1)
 var 
n:integer;
begin 
readln(n); 
if(n<0)then write(0) 
else write(n+4);
end.

2)
 var
  a, b: integer;
 begin
  readln(a, b);
  if(a = b) then
write(1)
  else
write(0);
end.

3)
var
  a, b, c, s: integer;
 begin
  s := 0;
  readln(a, b, c);
  if(a >= 0) then s := s + 1;
  if(b >= 0) then s := s + 1;
  if(c >= 0) then s := s + 1;
  write(s);
end.

4)
var
  a, b, c, s: integer;
 begin
  s := 0;
  readln(a, b, c);
  if(a > 0) then s := s + a;
  if(b > 0) then s := s + b;
  if(c > 0) then s := s + c;
  write(s);
end.
5)
 var
  a, b, c: integer;
 begin
  readln(a, b, c);
  if (a < b) then swap(a, b);
  if (a < c) then swap(a, c);
  if (b < c) then swap(b, c);
  write(a, ' ', b, ' ', c);
end.

6)
 var n, k, s, i: integer;
 begin
  s := 0;
  readln(n, k);
  for i := 1 to n.ToString.Length do
  if(strtoint(n.ToString[i]) > k) then s := s + strtoint(n.ToString[i]);
  write(s);
 end.

7)
 var n, s, i: integer;
 begin
  s := 0;
  readln(n);
  for i := 1 to n do
    s := s + i;
  write(s);
 end.

9)
 var n, i: integer;
 begin
  readln(n);
  for i := n downto 1 do
  write(i);
 end.

12
 var
  n, i: integer;
  s: real;
 begin
  s := 0;
  readln(n);
  for i := n downto 1 do
  s:=s+(0.1*i);
    write(s);
 end.

13)
 var n, i: integer;
 begin
  readln(n);
  for i := 1 to n do
    write(sqr(i), ' ');
end.

14)
 var
  n, i, c: integer;
 begin
  i := 1;
  c := 0;
  readln(n);
  while (c <> n) do
  begin
    if(i mod 3 = 0) then begin write(i, ' ');c := c + 1; end;
    i := i + 1;
  end;
end.

15)
 var
  n, i, a: integer;
  c: real;
 begin
  i := 1;
  c := 0;
  readln(n);
  for i := 1 to n do
   begin
    read(a);
    c := c + a;
  end;
  write(c / n)
end.

16)
 var
  n, i, a: integer;
 begin
  i := 1;
  while true do
   begin
    read(a);
    if(a = 0) then break;
    n := n + 1;
  end;
  write(n)
end.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота