М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
Lee35
Lee35
08.07.2021 04:04 •  Информатика

На языке Си. Автомат принимает трёхзначное число, вычисляет сумму двух старших разрядов (сотен и десятков), а также сумму двух младших разрядов (десятков и единиц). Затем эти суммы выводятся на экран в порядке убывания (без пробелов). Напишите программу, которая моделирует работу автомата.

👇
Ответ:
Васиози
Васиози
08.07.2021

#include <stdio.h>

int main()

{

int num;

printf("Vvedite trehznachnoe chislo: ");

scanf("%d", &num);

if (num / 100 + (num % 100) / 10 > (num % 100) / 10 + (num % 10))

 printf("%d%d", num / 100 + (num % 100) / 10, (num % 100) / 10 + (num % 10));

else

 printf("%d%d", (num % 100) / 10 + (num % 10), num / 100 + (num % 100) / 10);

return 0;

}

4,5(94 оценок)
Открыть все ответы
Ответ:
Fan111111
Fan111111
08.07.2021

Задание 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);

}

4,5(72 оценок)
Ответ:
18minina
18minina
08.07.2021

type

  base = record

     id: integer;

     ball: integer;

  end;

var

  t: text;

  a: array of array of integer;

  n: integer;

  st, tmp: string;

  err: integer := 1;

  database: base;

begin

  readln(n);

  setlength(a, n);

  for i: integer := low(a) to high(a) do

     setlength(a[i], 2);

  for i: integer := low(a) to high(a) do

  begin

     readln(st);

     tmp := st;

     delete(tmp, pos(' ', tmp, err), tmp.Length - pos(' ', tmp, err) + 1);

     database.id := strtoint(tmp);

     tmp := st;

     delete(tmp, 1, pos(' ', tmp, err));

     database.ball := strtoint(tmp);

     a[i, 0] := database.id;

     a[i, 1] := database.ball;

  end;

  var j: integer := 0;

  assign(t, 'output.txt');

  rewrite(t);

  while (j <= high(a)) do

  begin

     if (j + 1 < high(a)) and (a[j, 1] = a[j + 1, 1]) then

        if (a[j, 0] < a[j + 1, 0]) then begin

           write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

           write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');

        end else begin

           write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');

           write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

        end;

     if (j+1=n) then

        write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

     inc(j, 2);

  end;

  close(t);

end.

4,6(14 оценок)
Новые ответы от MOGZ: Информатика
Полный доступ к MOGZ
Живи умнее Безлимитный доступ к MOGZ Оформи подписку
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ