АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

1658. Семинар 3. Задание 4. Абстрактные классы. Вариант 2.

Time Limit: 1 seconds
Memory Limit:65536KB
Points:10
View Problem Statistics Submit Problem added Administrator

Семинар 3. Задание 4. Абстрактные классы. Вариант 2.

Формат входных данных.

Ввод:  Создать два объекта производного класса Integer, введя их значения, затем создать два объекта производного класса Real, введя их значения. Затем выполнять действия, предписанные командами ввода:

1- изменить первый объект класса Integer;

2- изменить второй объект класса Integer;

3 - изменить первый объект класса Real;

4- изменить второй объект класса Real;

0 - выход.

Вывод: После создания объектов, либо изменения их параметров, выводить сведения об объектах и результаты выполнения операций сложения, вычитания, умножения, деления.

Пример входных данных:

987654321 123456789

98765.4321 12345.6789

1 678901234

2 1112223334344

3 778899.8899

4 222333444.5678

0

Пример выходных данных:

Integer1 (987654321) Integer2 (123456789)
Integer1+Integer2 (1111111110)
Integer1-Integer2 (864197532)
Integer1*Integer2 (121932631112635269)
Integer1/Integer2 (8)
Real1 (98765.4321) Real2 (12345.6789)
Real1+Real2 (111111.1110)
Real1-Real2 (86419.7532)
Real1*Real2 (1219326311.12635269)
Real1/Real2 (8)
Integer1 (678901234) Integer2 (123456789)
Integer1+Integer2 (802358023)
Integer1-Integer2 (555444445)
Integer1*Integer2 (83814966397777626)
Integer1/Integer2 (5.499100)
Integer1 (678901234) Integer2 (1112223334344)
Integer1+Integer2 (1112902235578)
Integer1-Integer2 (-1111544433110)
Integer1*Integer2 (755089794169736180496)
Integer1/Integer2 (0.000610)
Real1 (778899.8899) Real2 (12345.6789)
Real1+Real2 (791245.5688)
Real1-Real2 (766554.2110)
Real1*Real2 (9616047935.95075311)
Real1/Real2 (63.090892)
Real1 (778899.8899) Real2 (222333444.5678)
Real1+Real2 (223112344.4577)
Real1-Real2 (-221554544.6779)
Real1*Real2 (173175495494947.17308522)
Real1/Real2 (0.003503)


View Problem Statistics Submit Author/source:
Educational Courses / Языки программирования / Семинар 12. Наследование. Задача 4 /
1653. 01 - Семинар 3. Задание 4. Абстрактные классы. Вариант 1. 1658. 1659. 03 - Семинар 3. Задание 4. Абстрактные классы. Вариант 3. 1673. 04 - Семинар 3. Задание 4. Абстрактные классы. Вариант 04. 1662. 05 - Семинар 3. Задание 4. Абстрактные классы. Вариант 5.
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.515 sec.
© Copyright VSTU, AVT, Nosov D.A.