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 <algorithm> | |
| #include <ctime> | |
| using namespace std; | |
| int main() | |
| { | |
| srand(time(nullptr)); // randomize |
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
| #pragma warning(disable:4996) | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <locale.h> | |
| #include <string.h> | |
| struct Student { | |
| char surname[32]; | |
| char group[32]; |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <locale.h> | |
| // Подсчет размера строки | |
| int strlen(char* a) { | |
| int i = 0; | |
| while (a[i] != '\0') { | |
| i++; | |
| } |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <locale.h> | |
| #include <ctype.h> | |
| // Функция сравнения строк | |
| int mystrcmp(char* s1, char* s2) { | |
| int i = 0; | |
| // пока одна из строк не закончится сравниваем символы | |
| while (s1[i] != '\0' && s2[i] != '\0') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| float cx = (x + x2 + x3) / 3; | |
| float cy = (y + y2 + y3) / 3; | |
| float l1 = std::sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy)); | |
| float l2 = std::sqrt((x2 - cx) * (x2 - cx) + (y2 - cy) * (y2 - cy)); | |
| float l3 = std::sqrt((x3 - cx) * (x3 - cx) + (y2 - cy) * (y2 - cy)); | |
| float dx = 2 * (x - cx) / l1 * (width / (float)glutGet(GLUT_WINDOW_WIDTH)); | |
| float dy = 2 * (y - cy) / l1 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT)); | |
| float dx2 = 2 * (x2 - cx) / l2 * (width / (float)glutGet(GLUT_WINDOW_WIDTH)); | |
| float dy2 = 2 * (y2 - cy) / l2 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT)); | |
| float dx3 = 2 * (x3 - cx) / l3 * (width / (float)glutGet(GLUT_WINDOW_WIDTH)); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <cassert> | |
| using namespace std; | |
| // Элемент очереди | |
| class Node { | |
| public: | |
| int value; // Значение | |
| Node *last; // Предыдущий элемент |
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
| /* Отключение предупреждений Visual Studio при | |
| использовании "небезопасных" функций (strtok) */ | |
| #pragma warning(disable : 4996) | |
| #include <iostream> | |
| #include <fstream> | |
| #include <string> | |
| #include <locale> | |
| #include <windows.h> |
OlderNewer