Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- //Števci za x,y,z in w pri izpisovanju številk
- int x = 0;
- int y = 0;
- int z = 0;
- int w = 0;
- //Števci za kolikokrat po vrsti izpiše določeno število na določeni poziciji
- int steveczaW = 0;
- int steveczaZ = 0;
- int steveczaY = 0;
- int steveczaX = 0;
- //Števec za kolikšna je vrstica pri podvajanju z 16
- int koliksnatamocna = 1;
- for (int steveczaVRSTICE = 0; steveczaVRSTICE <= 144; steveczaVRSTICE++)
- {
- //Začne znova ko konča prve kombinacije
- if (steveczaVRSTICE == 16 * koliksnatamocna)
- {
- x = koliksnatamocna;
- y = koliksnatamocna;
- z = koliksnatamocna;
- w = koliksnatamocna;
- steveczaW = 0;
- steveczaZ = 0;
- steveczaY = 0;
- steveczaX = 0;
- }
- //Začne znova ko konča prve kombinacije
- if (steveczaW == 0 && steveczaVRSTICE != 0 || steveczaW == 1 )
- {
- if (steveczaVRSTICE % 16 == 0)
- {
- koliksnatamocna = koliksnatamocna + 1;
- }
- if (steveczaW == 1)
- {
- if (steveczaVRSTICE != 16 * koliksnatamocna)
- {
- w = w - 1;
- }
- steveczaW = 0;
- }
- else
- {
- w = w + 1;
- steveczaW = 1;
- }
- }
- if (steveczaZ == 2 || steveczaZ == 4)
- {
- if (steveczaZ == 4)
- {
- if (steveczaVRSTICE != 16 * koliksnatamocna)
- {
- z = z - 1;
- }
- steveczaZ = 0;
- }
- else
- {
- z = z + 1;
- }
- }
- if (steveczaY == 4 || steveczaY == 8)
- {
- if (steveczaY == 8)
- {
- if (steveczaVRSTICE != 16 * koliksnatamocna)
- {
- y = y - 1;
- }
- steveczaY = 0;
- }
- else
- {
- y = y + 1;
- }
- }
- if (steveczaX == 8)
- {
- x = x + 1;
- steveczaX = 0;
- }
- //Izračun po njegovi ideji
- int a = z;
- int b = ((w + x) / 11);
- int c = ((x + y) / 11);
- int d = ((y + z) / 11);
- //Izračun po njegovi ideji s preverjanjem ali je to možno
- if (Convert.ToInt32(w + x) >= 10 && Convert.ToInt32(w + x) / 11 != 10)
- {
- Console.WriteLine($"{a}{b}{c}{d}");
- }
- if (Convert.ToInt32(x + y) >= 10 && Convert.ToInt32(x + y) / 11 != 10)
- {
- Console.WriteLine($"{a}{b}{c}{d}");
- }
- if (Convert.ToInt32(y + z) >= 10 && Convert.ToInt32(y + z) / 11 != 10)
- {
- Console.WriteLine($"{a}{b}{c}{d}");
- }
- //Dodajanje stevcem stevilo 1
- steveczaX = steveczaX + 1;
- steveczaY = steveczaY + 1;
- steveczaZ = steveczaZ + 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement