Write a program that reads an N x N matrix of integers and prints it out rotated 90 degrees to the right.
Input:
2 4 6 8 8 6 4 2 1 3 7 9 9 7 3 1
Output:
9 1 8 2 7 3 6 4 3 7 4 6 1 9 2 8
Some zombies are chasing a player. Here is a top-down view:
Image credit: © Copyright 2014-2020, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)
Each zombie can see infinitely far in a 180° field of view as indicated by the light blue half-circular shapes above. In the picture above, zombie A can see the player, but zombie B cannot.
Write a program that reads, on three lines:
the X-Y position of the player
the X-Y position of a zombie
the direction vector f indicating the direction the zombie is facing (like fA and fB above)
Each position or vector is a pair of floating-point numbers. The program should print "can see" if the zombie can see the player, otherwise "cannot see".
Write a program that reads a sequence of integers on a single line. The sequence is guaranteed to contain at most two distinct values. For example, it might be
17 17 17 11 17 11 11 11 17 11 17 11 11
The program should print out the sequence in sorted order:
11 11 11 11 11 11 11 17 17 17 17 17 17
How efficient is your program?
We know that in C# the 'int' type represents a signed 32-bit integer.
a) Pretend that you know that 'int' is signed, but don't know how many bits it has. Write a program that will determine the size of 'int' experimentally, and will write output such as
32 bits
b) Modify and rerun your program to determine the size of the C# type 'long'.
Solve Project Euler's problem 8, assuming that the input number is read from standard input.
Solve Project Euler's problem 11, assuming that the input number is read from standard input.
Solve Project Euler's problem 13, assuming that the input numbers are read from standard input.
(Project Euler, problem 16)
Write a program that determines the sum of the digits of the number 21000.
Solve Project Euler's Problem 19.
Solve Project Euler's problem 28.