Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void task_aqvarium() {
- cout << " Аквариум " << endl;
- double width = 4;
- double lenght = 6;
- double height = 2;
- //double width=6, lenght=2, height=3;
- /*
- cout << "Введите ширину в дм.:";
- cin >> width;
- cout << "Введите длинну в дм.:";
- cin >> lenght;
- cout << "Введите высоту в дм.:";
- cin >> height;
- */
- const double price = 30; // rub/litr
- double cost = width * lenght * height * price;
- cout << "Цена: " << cost << " рублей." << endl;
- }
- void test_type() {
- cout << "Тестируем преобразование типов" << endl;
- int val = 10;
- cout << typeid(val).name() << " "
- << sizeof(val) << " "
- << val << " "
- << &val << endl;
- short i1 = 1;
- int i2 = 2;
- long i3 = 3;
- long long i4 = 4;
- float d1 = 12.5;
- double d2 = 13.8;
- bool flag = true; // false
- char ch = '+';
- cout << ch << " " << flag << endl;
- cout << typeid( 1.0 * 3 / 2 ).name() << " "
- << 1.0 * 3 / 2 << endl;
- cout << typeid(1 + ch ).name() << " "
- << 1 + ch << endl;
- ch = 200434;
- cout << ch;
- cout << ch + 1 << endl;
- i2 = 15.6;
- cout << "i2 (15.6) : " << i2 << endl;
- int val1 = 65;
- cout << val1 << " " << (char)val1 << endl;
- cout << 98 << " " << (char)98 << endl;
- cout << (double)val1/2 << endl;
- cout << (bool)-10 << " "
- << bool(0) << " "
- << (bool)10 << endl;
- }
- void calc_time(int seconds) {
- int hours = seconds / (60 * 60);
- int minutes = (seconds / 60) % 60;
- int sec = seconds % 60;
- cout << hours << ":"
- << minutes << ":"
- << sec << endl;
- }
- void task_time() {
- int s = 36000;
- calc_time(s);
- int s2 = 24 * 60 * 60 - s;
- calc_time(s2);
- }
- int main() {
- setlocale(LC_ALL, "ru");
- //task_aqvarium();
- //test_type();
- task_time();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment