Бонус задачи и примерни тестове
Някой да знае полезни линкове за задачи по C#? И ако някой може да качи примерен изпит, за да можем да се упражняваме от по-рано.
Някой да знае полезни линкове за задачи по C#? И ако някой може да качи примерен изпит, за да можем да се упражняваме от по-рано.
Ще постна и една малко по - "засукана" задачка:
You are given a non-negative integer number N. Your task is to print the last 16 bits of the binary representation of N on the console. Every bit is printed in a rectangular area with 4 rows and 3 columns.
A bit with value of 1 should be printed in the format:
.#.
##.
.#.
###
A bit with value of 0 should be printed in the format:
###
#.#
#.#
###
Between every single bit there should be an empty column containing only dots (".").
The input data should be read from the console.
On the only input line there will be a non-negative integer number N which bits must be printed on the console.
The input data will always be valid and in the format described. There is no need to check it explicitly.
The output should be printed on the console.
You should print the last 16 bits of N on the console in the described format.
Your output should contain exactly 4 lines with 63 symbols on each line. Symbols should be only hashes ("#") and dots (".").
Input example |
Output example |
1
|
###.###.###.###.###.###.###.###.###.###.###.###.###.###.###..#. #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.##. #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..#. ###.###.###.###.###.###.###.###.###.###.###.###.###.###.###.###
|
1234
|
###.###.###.###.###..#..###.###..#...#..###..#..###.###..#..### #.#.#.#.#.#.#.#.#.#.##..#.#.#.#.##..##..#.#.##..#.#.#.#.##..#.# #.#.#.#.#.#.#.#.#.#..#..#.#.#.#..#...#..#.#..#..#.#.#.#..#..#.# ###.###.###.###.###.###.###.###.###.###.###.###.###.###.###.###
|
65535
|
.#...#...#...#...#...#...#...#...#...#...#...#...#...#...#...#. ##..##..##..##..##..##..##..##..##..##..##..##..##..##..##..##. .#...#...#...#...#...#...#...#...#...#...#...#...#...#...#...#. ###.###.###.###.###.###.###.###.###.###.###.###.###.###.###.### |
Ако имаш някакви затруднения и търсиш малко или много насока за решаване питай. Но се опитай като цяло за момента да се справиш сам :) Успех от мен :)