1) Input file The input file will never empty. It always contains two parts: a) A number k (k>0, k is an integer) stands for the size (size=width=height) of the matrix. b) A group of numbers a (a,...


Can you please code this part of the code. In c++.


The input here is:



Example 1 of input and output


input11.txt


4


2 4 0 0


2 0 0 0


0 0 0 0


0 0 8 0


Command line:


merge input=input11.txt output=output11.txt


output11.txt


122


1) Input file<br>The input file will never empty. It always contains two parts:<br>a) A number k (k>0, k is an integer) stands for the size<br>(size=width=height) of the matrix.<br>b) A group of numbers a (a, >=0, a, is an integer, 1<=i<=k, 1<=j<=k),<br>stand for the cells of the matrix.<br>2) Output file<br>The output file contains the moves. It should not contain spaces in between<br>each direction number. If the input matrix cannot be merged to one number,<br>

Extracted text: 1) Input file The input file will never empty. It always contains two parts: a) A number k (k>0, k is an integer) stands for the size (size=width=height) of the matrix. b) A group of numbers a (a, >=0, a, is an integer, 1<><=k,><><=k), stand="" for="" the="" cells="" of="" the="" matrix.="" 2)="" output="" file="" the="" output="" file="" contains="" the="" moves.="" it="" should="" not="" contain="" spaces="" in="" between="" each="" direction="" number.="" if="" the="" input="" matrix="" cannot="" be="" merged="" to="" one="" number,="" "impossible"="" should="" be="" outputted="" (case="" sensitive).="" 3.="" the="" rules="" and="" operations="" 1)="" create="" the="" matrix:="" by="" reading="" the="" input="" file,="" you="" should="" be="" able="" to="" create="" a="" matrix="" filled="" with="" the="" numbers.="" each="" number="" corresponds="" to="" one="" cell.="" after="" reading="" the="" example="" 1="" from="" below="" input11.txt,="" you="" should="" be="" able="" to="" create="" a="" matrix="" as="" follow="" table="" 1:="" table="" 1="" 4="" 8="" 2.="">

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here