19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

294 Chapter 7 Multidimensional Arrays<br />

program that prompts the user <strong>to</strong> enter the number n and the array of characters, as<br />

shown in the sample output, and checks if the input array is a Latin square. The<br />

characters are the first n characters starting from A.<br />

Enter number n: 4<br />

Enter 4 rows of letters separated by spaces:<br />

A B C D<br />

B A D C<br />

C D B A<br />

D C A B<br />

The input array is a Latin square<br />

Enter number n: 3<br />

Enter 3 rows of letters separated by spaces:<br />

A F D<br />

Wrong input: the letters must be from A <strong>to</strong> C

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!