Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void calc2nums() {
- int val1 = 0;
- int val2 = 0;
- cout << "input two numbers" << endl;
- cin >> val1 >> val2;
- cout << val1 << " + " << val2;
- cout << " = " << val1 + val2 << endl;
- cout << val1 << " * " << val2;
- cout << " = " << val1 * val2 << endl;
- cout << "average(" << val1;
- cout << ", " << val2 << ")";
- cout << " = " << (float)(val1 + val2) / 2 << endl;
- }
- void convertChars() {
- char ch = 'a';
- cout << ch << '\t' << (int)ch << endl;
- unsigned int val = 123;
- cout << val << '\t' << (char)val << endl;
- cout << R"(\t)" << '\t' << (int)'\t' << endl;
- cout << (unsigned char)(-10) << " " << (char)-10 << endl;
- cout << (unsigned int)(-10) << " " << (int)-10 << endl;
- }
- void calcPriceLabtop() {
- setlocale(LC_ALL, "Russian");
- cout << " Покупка ноутбука. " << endl;
- float price; // цена
- unsigned int number;// количество
- int sale; // скидка
- cout << "Введите цену ноутбука: "; cin >> price;
- cout << "Введите количество ноутбуков: "; cin >> number;
- cout << "Ведите величину скидки: "; cin >> sale;
- float procent = (1 - sale / 100.0);
- cout << "ИТОГО: " << number * price * procent << endl;
- }
- void getChetNum() {
- int val;
- cout << "Введите целое число: "; cin >> val;
- if ((val % 2) == 0)
- cout << "Число " << val << " четное." << endl;
- else
- cout << "Число " << val << " нечетное." << endl;
- }
- void showMin() {
- int val1, val2;
- cout << "Введите два числа:" << endl;
- cin >> val1;
- //cout << "\b\b\b\b";
- cin >> val2;
- //cout << "\b\b\b\b";
- if (val1 < val2)
- cout << val1;
- else
- cout << val2;
- }
- void main() {
- //calcPriceLabtop();
- setlocale(LC_ALL, "Russian");
- //getChetNum();
- //showMin();
- cout << "Hello world\b!" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment