-
Notifications
You must be signed in to change notification settings - Fork 292
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
Lab2 #1133
Lab2 #1133
Conversation
Lab2C/lab2.c
Outdated
int main() { | ||
|
||
FILE* input_file = fopen("input.txt", "r"); | ||
FILE* output_file = fopen("output.txt", "w"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно открывать файлы, переданные в качестве параметров.
Lab2C/CMakeLists.txt
Outdated
set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/input.txt) | ||
set(OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/output.txt) | ||
|
||
add_test(NAME TestLab2C COMMAND Lab2C ${CMAKE_CURRENT_BINARY_DIR}/input.txt ${CMAKE_CURRENT_BINARY_DIR}/output.txt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Входной файл можно передавать прямо из исходного каталога, не обязательно его копировать.
Lab2C/lab2.c
Outdated
#include "stack.h" | ||
|
||
bool is_matching_tag(const char* opening, const char* closing) { | ||
return strcmp(opening + 1, closing + 2) == 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не учитывается, что строки могут быть в разном регистре.
Lab2C/CMakeLists.txt
Outdated
target_include_directories(Lab2C PUBLIC ../LibraryC) | ||
target_link_libraries(Lab2C LibraryC) | ||
|
||
add_test(NAME TestLab2C COMMAND Lab2C ${CMAKE_CURRENT_SOURCE_DIR}/input.txt ${CMAKE_CURRENT_SOURCE_DIR}/output.txt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выходной файл не должен находиться в каталоге с исходниками.
Lab2C/output.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот файл не нужен в репозитории.
Принято.
В первой строке входного файла записаны числа N и M - высота и ширина прямоугольной доски. На ней расположены несколько клеток (координаты (от 1 до N и от 1 до M) которых записаны в следующих строках), покрашенные в цвет с интенсивностью 1. Далее делается несколько ходов. На каждом ходу все пустые клетки, граничащие с другими клетками с интенсивностью k, красятся в цвет k+1. Написать программу, использующую очередь, для определения того, в какое количество цветов будет покрашена вся доска. Входные данные
Выходные данные
|
No description provided.