subject

Write a program that takes input from stdin with the following properties: input is split into lines delimited by newline characters. every line has the same length. every line consists of an arbitrary sequence of hyphens ("-") and asterisks ("*").the final line of input is terminated by a newline character. in this challenge, each character in the input will have coordinates defined by (line number, character number), starting at the top and left. so the first character on the first line will have the coordinates (1,1) and the fifth character on line 3 will have the coordinates (3,5).the program should find a box (or boxes) in the input with the following properties: the box must be defined by two pairs of coordinates corresponding to its top left and bottom right corners. it must be the minimum bounding box for some contiguous group of asterisks, with each asterisk being horizontally or vertically (but not diagonally) adjacent to at least one other asterisk in the group. the box should not strictly bound the group, so the coordinates for the box in the following input should be (2,2)(3,3) not (1,1)(4,**--** should not overlap (i. e. share any characters with) any other minimum bounding boxes. of all the non-overlapping, minimum bounding boxes in the input, it should be the largest. if any boxes satisfying the conditions can be found in the input, the program should return an exit code of 0 and, for each box, print a line to stdout with the two pairs of coordinates. so, given the file “groups. txt” with the following content: -*--**running your program with this input would look something like this: > cat groups. txt | bounding-box(1,1)(2,2)this is because the larger groups on the right of the input have overlapping bounding boxes, so the returned coordinates bound the smaller group on the top left.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:30
In your ice breakers game, what happens when the snowball collides with one of the snowboards? a. the player's score will increase. b. the snowball will leave the play area. c. the snowball will be destroyed. d. the snowball will bounce.
Answers: 1
question
Computers and Technology, 22.06.2019 12:40
How do i get the most points, without any effort?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
You know the right answer?
Write a program that takes input from stdin with the following properties: input is split into lines...
Questions
question
Mathematics, 25.04.2020 22:08
question
English, 25.04.2020 22:09
Questions on the website: 13722361