Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program {
- static bool[,] table = new bool[50,50];
- static void print() {
- for (int i = 0; i < 50; ++i) {
- for (int j = 0; j < 50; ++j) {
- Console.Write(table[i, j] ? "." : "X");
- }
- Console.Write("\n");
- }
- }
- static void Main(string[] args) {
- Bitmap img = new Bitmap("rejtveny.bmp");
- for (int i = 0; i < 50; i++) {
- for (int j = 0; j < 50; j++) {
- Color pixel = img.GetPixel((int)Math.Round(4.92/2 + j * 4.92), (int)Math.Round(4.92/2 + i * 4.92));
- if (pixel.R == 255 && pixel.G == 255 && pixel.B == 255) {
- table[i,j] = true;
- } else {
- table[i, j] = false;
- }
- }
- }
- System.IO.StreamReader file = new System.IO.StreamReader("szamok.txt");
- string line;
- List<int> numbers = new List<int>();
- while ((line = file.ReadLine()) != null) {
- if (line.Length == 5) {
- numbers.Add(int.Parse(line));
- }
- }
- file.Close();
- numbers.Sort();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement