#include <iostream>
int main() {
int count = 0;
long num;
std::cout << "Введите ваше число: ";
std::cin >> num;
int previous1 = -1;
int previous2 = -1;
int current;
while (num > 0) {
current = num % 10;
num /= 10;
if (previous2 == 7 && previous1 == 7 && current == 7) {
count += 1;
break;
}
previous2 = previous1;
previous1 = current;
}
if (count > 0) {
std::cout << 'T' << std::endl;
} else {
std::cout << 'F' << std::endl;
}
return 0;
}
struct FilePatch {
int lineNumber;
char* oldLine;
char* newLine;
};
struct FileDiff {
FilePatch* patches;
int patchCount;
};
void applyDiff(char** fileContent, FileDiff* diff) {
for (int i = 0; i < diff->patchCount; ++i) {
int lineNumber = diff->patches[i].lineNumber;
fileContent[lineNumber] = diff->patches[i].newLine;
}
}
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
char* get_part_path(const char* s, const char* find_path) {
const char* start = strstr(s, find_path);
if (!start) {
return NULL;
}
start += strlen(find_path);
while (*start == '/') {
start++;
}
const char* end = strchr(start, '/');
if (!end) {
end = s + strlen(s);
}
size_t len = end - start;
char* result = (char*)malloc(len + 1);
if (result) {
strncpy(result, start, len);
result[len] = '\0';
}
return result;
}
int main() {
assert(strcmp(get_part_path("/base/4", "/"), "base") == 0);
assert(strcmp(get_part_path("base/4", "/"), "base") == 0);
assert(strcmp(get_part_path("/base/4", "/base"), "4") == 0);
assert(strcmp(get_part_path("base/4", "/base"), "4") == 0);
assert(strcmp(get_part_path("base/4", "/base/4"), "4") == 0);
printf("All tests passed!\n");
return 0;
}