Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request | Martin Kirchev | Seminar 1, 2, 3, 4 #19

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
################################################################################

/.vs
/.gitignore
/.gitignore
/.gitignore
21 changes: 21 additions & 0 deletions CppProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"inheritEnvironments": [
"msvc_x64"
],
"name": "x64-Release",
"includePath": [
"${env.INCLUDE}",
"${workspaceRoot}\\**"
],
"defines": [
"WIN32",
"NDEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "windows-msvc-x64"
}
]
}
180 changes: 180 additions & 0 deletions MySolutions/Seminar01.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
// MK_Project.cpp : This file contains the 'main' function. Program execution begins and ends there.

#include <iostream>
using namespace std;

int main()
{
// Zad_1
//cout << "Oh what \na happy day! \nOh yes, \nwhat a happy day!\n";

// Zad_2
//double a = 5.4;
//double b = 7.9;

//double P = 2 * a + 2 * b;
//double S = a * b;

//cout << "P: " << P
// << "\nS: " << S << "\n";

// Zad_3
//double BGN;
//cin >> BGN;

//double USD = BGN * 0.51;
//double EUR = BGN * 0.56;

//cout << "USD: " << USD
// << "\nEUR:" << EUR << "\n";

// Zad_4
//cout << "Please enter the length of the first side: ";

//double a;
//cin >> a;

//cout << "\nPlease enter the length of the second side: ";

//double b;
//cin >> b;

//double P = 2 * a + 2 * b;
//double S = a * b;

//cout << "\nP: " << P
// << "\nS: " << S << "\n";

// Zad_5
//int num1, num2;
//cin >> num1 >> num2;

//bool biggerThanFirst = (num1 > num2);

//cout << biggerThanFirst;

// Zad_6
//int num1, num2;

//cout << "Dividend: ";
//cin >> num1;

//cout << "Divisor: ";
//cin >> num2;

//cout << "The quotient of the division is : " << num1 / num2 << "\n";
//cout << "The remainder of the division is : " << num1 % num2 << "\n";

// Zad_7
//int apples, pears, bananas;

//cout << "Apples: ";
//cin >> apples;

//cout << "Pears: ";
//cin >> pears;

//cout << "Bananas: ";
//cin >> bananas;

//cout << "Pesho, don�t forget to buy " << apples << " apples, " << pears << " pears and " << bananas << " bananas!\n";

// Zad_8
//double r;
//double d = r * 2;
//double PI = 3.14159265;

//cout << "r = ";
//cin >> r;

//double C = 2 * PI * d;
//cout << "C = " << C << "\n";

//double S = PI * r * r;
//cout << "S = " << S << "\n";

// Zad_9
//int a, b, c;
//cin >> a >> b >> c;

//int D = b * b - 4 * a * c;
//int x1 = (- b - sqrt(D)) / (2 * a);
//int x2 = (- b + sqrt(D)) / (2 * a);

//cout << "x1 = " << x1 << ", x2 = " << x2;

// Zad_10
//int num1, num2;
//cin >> num1 >> num2;

//cout << num1 << " " << num2 << "\n";

//int variable = num1;
//num1 = num2;
//num2 = variable;

//cout << num1 << " " << num2 << "\n";

//Yslovie 2

//int num1, num2;
//cin >> num1 >> num2;

//cout << num1 << " " << num2 << "\n";

//num1 = num1 + num2;
//num2 = num1 - num2;
//num1 = num1 - num2;

//cout << num1 << " " << num2 << "\n";

//Zad_11
//int num1, num2;
//cin >> num1 >> num2;

//bool is_a_bigger = num1 > num2;
//bool is_b_bigger = num1 < num2;

//cout << "Max: " << ((is_a_bigger * num1) + (is_b_bigger * num2)) << endl << "Min: " << ((is_b_bigger * num1) + (is_a_bigger * num2));

//Zad_12
//int secondsInput;
//cout << "Seconds: ";
//cin >> secondsInput;

// 60 sec -> 1 min
// 60 min - 1 hour
// 24 hours - 1 day
// 60 * 60 * 24 = 86400

//int days = secondsInput / 86400;
//secondsInput %= 86400;

//int hours = secondsInput / 3600;
//secondsInput %= 3600;

//int minutes = secondsInput / 60;
//secondsInput %= 60;

//int seconds = secondsInput;

//cout << days << " days, " << hours << " hours, " << minutes << " minutes and " << seconds << " seconds\n";

//Zad_13
//double x1, y1;
//double x2, y2;

//cin >> x1 >> y1;
//cin >> x2 >> y2;

//double distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не използвай pow

//cout << distance;

//Zad_14
//int n;
//cout << "n: ";
//cin >> n;

//cout << (n * (n + 1)) / 2;

}