По разделам

 

Решение задачи Integer 4


Даны целые положительные числа A и B (A > B). На отрезке длины A размещено максимально возможное количество отрезков длины B
(без наложений). Используя операцию деления нацело, найти количество
отрезков B, размещенных на отрезке A.

Код (C/C++)

#include <iostream>
using namespace std;
int main(){
	int a,b;
	cout << "Vvedite A: ";
	cin >> a;
	cout << "Vvedite B: ";
	cin >> b;
	cout << "Kolichestvo otrezkov dlinoy B v otrezke dlinoy A: " << int(a/b);
	return 0;
}

Код (Python)

import random

A = random.randrange(1,100)
B = random.randrange(1,A)
print("A = ", A)
print("B = ", B)
x = int(A/B)
print("Количество полных B в A: ", x)
									

Код (Pascal)

program Integer4;
var
  A, B, Res: Integer;
begin
  Write('Введите длину отрезка A: ');
  Readln(A);
  Write('Введите длину отрезка B: ');
  Readln(B);
  Res:=A div B;
  Writeln('В отрезке A содержится ',Res,' полных отрезков B.');
end.
									




Integer. Абрамян
Integer 1 Просмотров: 12398
Integer 2 Просмотров: 7826
Integer 3 Просмотров: 8285
Integer 4 Просмотров: 36278
Integer 5 Просмотров: 8645
Integer 6 Просмотров: 7231
Integer 7 Просмотров: 7143
Integer 8 Просмотров: 5698
Integer 9 Просмотров: 4774
Integer 10 Просмотров: 6411
Integer 11 Просмотров: 6780
Integer 12 Просмотров: 7194
Integer 13 Просмотров: 6664
Integer 14 Просмотров: 3660
Integer 15 Просмотров: 4600
Integer 16 Просмотров: 3790
Integer 17 Просмотров: 4084
Integer 18 Просмотров: 3743
Integer 19 Просмотров: 5594
Integer 20 Просмотров: 4354
Integer 21 Просмотров: 4678
Integer 22 Просмотров: 3810
Integer 23 Просмотров: 4722
Integer 24 Просмотров: 8632
Integer 25 Просмотров: 3811
Integer 26 Просмотров: 3367
Integer 27 Просмотров: 3192
Integer 28 Просмотров: 4000
Integer 29 Просмотров: 5284
Integer 30 Просмотров: 4852

Комментарии

Чтобы написать комментарии вам нужно войти в систему или зарегистрироваться



Заявка на расчет