mizery1
24.10.2020 13:21

Сор информатика надо весь сор сделать​


Сор информатика надо весь сор сделать​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Анамтасия727
06.04.2023 22:09
Везде значения вводятся с клавиатуры!
на java
если изучали массив:
public class qwert {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int[] a = new int[5];
int k = 0;
for (int i = 0; i < 5; i++) {
a[i] = scn.nextInt();
k = k + a[i];
if (i == 4)
System.out.println(k/i);
}
}}
если не изучали массив:
public class qwert {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int a = scn.nextInt();
int b = scn.nextInt();
int c = scn.nextInt();
int d = scn.nextInt();
int e = scn.nextInt();
int s = (a + b + c + d + e) / 5;
System.out.println(s);
}}
на паскале через массив:
var a:array [1..5] of integer;
i:integer;
s:real;
begin
for i := 1 to 5 do
begin
readln(a[i]);
s := s + a[i];
if i = 5
then
write (s/i);
end;
end.
не через масивы:
var a,b,c,d,e :integer;
s:real;
begin
readln(a,b,c,d,e);
s := (a+b+c+d+e)/5;
write(s);
end.
0,0(0 оценок)
Ответ:
DeFauLD
06.04.2023 22:09

var

  s : string;

  i : integer;

  f : boolean;

begin

  readln (s);

  writeln ('Тут ', length (s), ' символов');

  f := true;  

for i := 1 to length (s) div 2 do

    if s[i] <> s[length (s) - i + 1] then f := false;

  writeln ('Это слово является перевертышем: ', f); //True/False

end.

 

var

  s : string;

  i, k, count : integer;

  c : char;

begin

  readln (s);

  count := 0;

  for i := 1 to length (s) do

    if s[i] <> ' ' then

    begin

       c := s[i];

       k := i + 1;

       break;

    end;

  for i := k to length (s) do

    if (s[i] = ' ') and (c <> ' ') then

    begin

       if s[i - 1] = c then inc (count);

       c := ' ';

    end

    else if c = ' ' then c := s[i];

  if (c <> ' ' ) and (s[length (s)] <> ' ') and (c = s[length (s)]) then inc (count);

  writeln (count);

end.

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота