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, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
question
Computers and Technology, 22.06.2019 19:10
What a backup plan that you have created in a event you encounter a situation
Answers: 2
question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
You know the right answer?
Write a program that takes input from stdin with the following properties: input is split into lines...
Questions