Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void divided3() {
- int k = 0;
- cout << "Введите число :";
- cin >> k;
- if (k % 3 == 0) {
- cout << "Делится";
- }
- else {
- cout << "Не делится";
- }
- cout << endl;
- }
- void from_min_to_max() {
- double a, b;
- cout << "Введите два числа: \n";
- cin >> a >> b;
- if (a < b) {
- cout << a << ", " << b;
- }
- else {
- cout << b << ", " << a;
- }
- cout << endl;
- }
- void from_min_to_max2() {
- double a, b;
- cout << "Введите два числа: \n";
- cin >> a >> b;
- if (a < b) {
- cout << a << ", " << b;
- }
- else {
- if (a > b) {
- cout << b << ", " << a;
- }
- else {
- cout << "Равны " << a;
- }
- }
- cout << endl;
- }
- void baby() {
- cout << 1 << ", ";
- cout << 2 << ", ";
- goto vasya;
- cout << 3 << ", ";
- vasya: cout << 4 << ", ";
- cout << 5 << endl;
- }
- void test_repeat() {
- repeat: from_min_to_max();
- char ch;
- cout << "Повторим? (y если да)";
- cin >> ch;
- if ((ch == 'y') || (ch == 'Y'))
- goto repeat;
- }
- void test_getch() {
- char a;
- //cin >> a;
- a = _getch(); // В отлиичии от cin не дожидается нажатия Enter
- // и не выводит ничего на консоль
- cout << (char)(a + 1);
- cout << (char)(a + 1);
- cout << (char)(a + 1);
- }
- void admittance() {
- int ball, summ = 0;
- cin >> ball;
- summ = summ + ball;
- cin >> ball;
- summ = summ + ball;
- cin >> ball;
- summ = summ + ball;
- cin >> ball;
- summ = summ + ball;
- cin >> ball;
- summ = summ + ball;
- if (summ >= 5 * 4)
- cout << "Допущен";
- else
- cout << "Не допущен";
- cout << endl;
- }
- void admittance2() {
- int a1, a2, a3, a4, a5, summ = 0;
- cin >> a1 >> a2 >> a3 >> a4 >> a5;
- summ = a1 + a2 + a3 + a4 + a5;
- double aver = summ / 5.0;
- if (aver >= 4)
- cout << "Допущен";
- else
- cout << "Не допущен";
- cout << endl;
- }
- void do_calc() {
- double x, y;
- char op;
- cout << "Введите выражение: "
- << "(число) (оператор +, -, *, / ) (число)" << endl;
- cin >> x >> op >> y;
- cout << x << op << y << " = ";
- if (op == '+')
- cout << x + y;
- else if (op == '-')
- cout << x - y;
- else if (op == '*')
- cout << x * y;
- else if (op == '/')
- if (abs(y) > 1.e-6) // ((y < -1.e-6) || (y > 1.e-6))
- cout << x / y;
- else
- cout << "Очень маленький y";
- cout << endl;
- }
- void test_eqal_double() {
- float x, y;
- x = 0.1;
- y = 0.5;
- if ((x+x+x+x+x) == y) {
- cout << "Ok" << endl;
- }
- else {
- cout << "Странно" << endl;
- }
- double eps = (x + x + x + x + x) - y;
- cout << eps;
- }
- void is_round(double r1, double r2){
- cout << "Введите координаты";
- double x, y, r;
- cin >> x >> y;
- r = sqrt(pow(x,2) + pow(y,2));
- if ((r > r1) && (r < r2)) {
- cout << "Ok" << endl;
- }
- else {
- cout << "Не Ок" << endl;
- }
- }
- int main() {
- setlocale(LC_ALL, "ru");
- //divided3();
- //test_repeat();
- //from_min_to_max2();
- //baby();
- //admittance();
- //do_calc();
- //test_eqal_double();
- is_round(5, 10);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment