Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem J2: Magic Squares Problem Deseription Magic Squares are square arrays of numbers that have the interesting property that the numbers in each column, and

image text in transcribed
image text in transcribed
Problem J2: Magic Squares Problem Deseription Magic Squares are square arrays of numbers that have the interesting property that the numbers in each column, and in each row, all add up to the same total. Given a 4 x 4 square of numbers, determine if i is magic square Input Specification The input consists of four lines, each line having 4 space-separated integers Output Specification Output either magic if the input is a magic square, or not magic if the input is not a magic square Sample Input 1 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1 Output for Sample Input I magic Explanation for Output for Sample Input 1 Notice that each row adds up to 34, and each column also adds up to 34 Sample Input 2 5 10 1 3 10 4 2 3 1 2 8 5 3 3 5 0 Output for Sample Input 2 not magic Explanation for Output for Sample Input 2 Notice that the top row adds up to 19, but the rightmost column adds up to 11 use python to solve it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

to encourage a drive for change by developing new ideas;

Answered: 1 week ago

Question

4 What are the alternatives to the competences approach?

Answered: 1 week ago