This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1) Вывести на экран консоли надпись : | |
| /* | |
| #include <iostream> | |
| using namespace std; | |
| int main(){ | |
| cout << "\n"; | |
| cout << " \"To be\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Написать программу, которая предоставляет пользователю возможность ввести с клавиатуры количество гривен, и переводит это количество в доллары, евро и биткоины. | |
| /* | |
| #include <iostream> | |
| #include <iomanip> | |
| using namespace std; | |
| int main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Ввести число, и определить – чётное оно, или нет. | |
| /* | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, "UKR"); | |
| int number; | |
| cout << "Введите первое число: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. С клавиатуры вводится целое число.Вывести на экран все числа, на которые введённое число делится без остатка.Например, для 60 такими числами станут 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60. | |
| /* | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, "UKR"); | |
| int number; | |
| cout << "Введите число: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Ввести массив из 5 чисел, а затем вывести его в обратном порядке. | |
| /* | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, "UKR"); | |
| int const SIZE = 4; | |
| int massive[SIZE] = { 5, 2, 4, 2 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <windows.h> | |
| #include <conio.h> | |
| using namespace std; | |
| enum KeyCodes { ENTER = 13, ESCAPE = 27, LEFT = 75, RIGHT = 77, UP = 72, DOWN = 80, SPACEBAR = 32 }; | |
| enum Colors { DARKGREEN = 2, RED = 12, YELLOW = 14, BLUE = 9, PINK = 4, WHITE = 5, MAGENTA = 13 }; | |
| enum Objects { HALL, WALL, COIN, ENEMY, BOMB, BONUS_ENERGY, BONUS_HP, SECOND_ENEMY, THIRD_ENEMY }; | |
| void generation_location(int HEIGHT, int WIDTH, int location[][50]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [master] | |
| GO | |
| /****** Object: Database [Store] Script Date: 14.02.2025 00:27:13 ******/ | |
| CREATE DATABASE [Store] | |
| CONTAINMENT = NONE | |
| ON PRIMARY | |
| ( NAME = N'Store', FILENAME = N'C:\MyStore\Store.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ) | |
| LOG ON | |
| ( NAME = N'Store_log', FILENAME = N'C:\MyStore\Store_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB ) | |
| WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 1. Посчитать возможную выручку за хлеб и молоко (с учётом скидок на эти товары) | |
| -- SELECT *, ROUND(price * quantity - price - discount, 2) [общая сумма] -- работает даже без AS | |
| -- FROM Product | |
| -- WHERE name LIKE '%Хлеб%' OR name LIKE '%Молоко%' | |
| -- 2. Получить информацию о том, каких товаров вчера и сегодня доставили более 10 штук (getdate, dateadd) | |
| -- SELECT * | |
| -- FROM Product | |
| -- WHERE date_of_delivery = CAST(GETDATE() AS DATE) OR date_of_delivery = CAST(DATEADD(DAY, -1, GETDATE()) AS DATE) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --INNER JOINS | |
| --1. Показать названия и категории товаров, поставщиками которых являются 000 “Паньки” или 000 «Какие люди» | |
| --SELECT | |
| --p.name AS Товар, | |
| --c.name AS Категория, | |
| --sr.name AS Поставщик | |
| --FROM Product p | |
| --JOIN Category c ON p.id_category = c.id | |
| --JOIN Supplier sr ON p.id_supplier = sr.id | |
| --WHERE sr.name IN ('Dairy World', 'Global Bakery') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --1. Показать товары, средняя цена продажи которых была больше 50 гривен | |
| --SELECT | |
| --p.name AS Товары, | |
| --SUM(s.price) AS Цена | |
| --FROM Product p | |
| --JOIN Sale s ON s.id_product = p.id | |
| --GROUP BY p.name | |
| --HAVING AVG(s.price) > 50 | |
| --2. Вывести количество товаров каждой категории, средняя цена поставки которых больше 100 гривен |
OlderNewer