ΠΠ²ΠΎΠΈΡΠ½ΡΠΉ ΡΡΠΌΠΌΠ°ΡΠΎΡ.
ΠΠ±ΡΡΠ°ΡΡΠ°Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°
If (label16. Text == «1» && label17. Text == «1») {timer5. Enabled = true; lineShape37. BorderColor = Color. LimeGreen; lineShape36. BorderColor = Color. LimeGreen; lineShape35. BorderColor = Color. LimeGreen; lineShape4. BorderColor = Color. LimeGreen; lineShape2. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΠ²ΠΎΠΈΡΠ½ΡΠΉ ΡΡΠΌΠΌΠ°ΡΠΎΡ. ΠΠ±ΡΡΠ°ΡΡΠ°Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
Π¦Π΅Π»ΡΡ ΠΌΠΎΠ΅ΠΉ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π±ΡΠ»ΠΎ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠ°ΡΡ ΠΎΠ±ΡΡΠ°ΡΡΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°Ρ , ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡΡΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ ΠΏΠΎΠ½ΡΡΡ ΠΏΡΠΈΠ½ΡΠΈΠΏ ΡΠ°Π±ΠΎΡΡ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΡΡΠΌΠΌΠ°ΡΠΎΡΠΎΠ², Π° ΡΠ°ΠΊΠΆΠ΅ Π½Π°ΡΡΠΈΡΡΡΡ ΡΠΊΠ»Π°Π΄ΡΠ²Π°ΡΡ ΡΠΈΡΠ»Π° Π² Π΄Π²ΠΎΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ ΡΡΠΈΡΠ»Π΅Π½ΠΈΡ. ΠΠ΅ΡΠΎΠΌΠ½Π΅Π½Π½ΠΎ, Π²Π°ΠΆΠ½ΠΎΠΉ ΡΠ°ΡΡΡΡ Π»ΡΠ±ΠΎΠΉ ΠΎΠ±ΡΡΠ°ΡΡΠ΅ΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΡΠ²Π»ΡΠ΅ΡΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΏΡΠΎΠ²Π΅ΡΠΈΡΡ ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΡΠ΅ Π·Π½Π°Π½ΠΈΡ.
1. ΠΡΠ½ΠΎΠ²Π½Π°Ρ ΡΠ°ΡΡΡ
1.1 ΠΠΏΠΈΡΠ°ΡΠ΅Π»ΡΠ½Π°Ρ ΠΏΠΎΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π·Π°Π΄Π°ΡΠΈ
Π ΡΠ²ΠΎΠ΅ΠΉ ΡΠ°Π±ΠΎΡΠ΅ Ρ ΠΏΠΎΡΡΠ°ΡΠ°ΡΡΡ ΡΠΎΠ·Π΄Π°ΡΡ ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅Π½Π½ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΠΊΠΎΡΠΎΡΠΎΠΉ ΡΠ΅Π»ΠΎΠ²Π΅ΠΊ ΠΌΠΎΠΆΠ΅Ρ Π½Π΅ ΡΠΎΠ»ΡΠΊΠΎ Π½Π°ΡΡΠΈΡΡΡΡ ΡΠΊΠ»Π°Π΄ΡΠ²Π°ΡΡ ΡΠΈΡΠ»Π° Π² Π΄Π²ΠΎΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ ΡΡΠΈΡΠ»Π΅Π½ΠΈΡ, Π½ΠΎ ΠΈ ΠΏΠΎΠ½ΡΡΡ, ΠΊΠ°ΠΊ ΡΠ°Π±ΠΎΡΠ°ΡΡ Π΄Π²ΠΎΠΈΡΠ½ΡΠ΅ ΡΡΠΌΠΌΠ°ΡΠΎΡΡ, Π° ΡΠ°ΠΊΠΆΠ΅ ΠΏΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΡΠ΅ Π·Π½Π°Π½ΠΈΡ.
ΠΠΎΡΠ»Π΅Π΄Π½Π΅Π΅ Π²ΡΠ΅ΠΌΡ Π²ΡΠ΅ Π±ΠΎΠ»Π΅Π΅ ΠΈΠ΄Π΅Ρ ΡΠ΅Π½Π΄Π΅Π½ΡΠΈΡ Π½Π° «ΡΠ»Π΅ΠΊΡΡΠΎΠ½Π½ΠΎΠ΅ ΠΎΠ±ΡΡΠ΅Π½ΠΈΠ΅». ΠΡΠ΄ΠΈ ΡΠΊΠ°ΡΠΈΠ²Π°ΡΡ ΠΎΠ±ΡΡΠ°ΡΡΠΈΠ΅ ΡΠΎΠ»ΠΈΠΊΠΈ, ΠΎΠ±ΡΡΠ°ΡΡΠΈΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Π·Π°ΠΏΠΈΡΡΠ²Π°ΡΡΡΡ Π½Π° Π²Π΅Π±ΠΈΠ½Π°ΡΡ ΠΈ Ρ. Π΄. ΠΠ±ΡΡΠ°ΡΡΠ°Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΡΠ΅ΡΠ°Π΅Ρ ΡΠ°ΠΊΠΈΠ΅ ΡΠ»ΠΎΠΆΠ½ΡΠ΅ Π²ΠΎΠΏΡΠΎΡΡ ΠΊΠ°ΠΊ:
1. ΠΡΠ΅ΠΌΡ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ. ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π²ΠΎΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ ΠΎΠ±ΡΡΠ°ΡΡΠ΅ΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΎΠΉ ΠΊΠΎΠ³Π΄Π° Ρ ΠΎΡΠΈΡΠ΅ ΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ Π΅ΠΉ ΡΠΊΠΎΠ»ΡΠΊΠΎ Π²Π°ΠΌ ΡΠ³ΠΎΠ΄Π½ΠΎ.
2. ΠΠΎΠ½ΡΡΠ½ΠΎΡΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΈ. Π Π°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ ΡΡΠ°ΡΠ°ΡΡΡΡ ΡΠ΄Π΅Π»Π°ΡΡ ΡΠ°ΠΊ, ΡΡΠΎΠ±Ρ ΡΠ΅Π»ΠΎΠ²Π΅ΠΊ, Π½Π΅ ΠΈΠΌΠ΅Ρ Π½ΠΈΠΊΠ°ΠΊΠΈΡ Π·Π½Π°Π½ΠΈΠΉ, ΡΠΌΠΎΠ³ ΠΏΠΎΠ½ΡΡΡ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½Π½ΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ.
3. ΠΠ½ΠΎΠ³ΠΎΠΎΠ±ΡΠ°Π·ΠΈΠ΅ ΡΠ΅ΠΆΠΈΠΌΠΎΠ². ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΌΠΎΠΆΠ΅Ρ Π²ΠΊΠ»ΡΡΠ°ΡΡ Π² ΡΠ΅Π±Ρ ΠΊΠ°ΠΊ ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΡΡ ΡΠ°ΡΡΡ, ΡΠ°ΠΊ ΠΈ ΡΠ΅ΡΡΡ, Π·Π°Π΄Π°Π½ΠΈΡ, ΡΠ΅ΡΠ΅Π½ΠΈΡ, ΠΎΠ±ΡΡΡΠ½Π΅Π½ΠΈΡ ΠΈ Ρ. Π΄.
ΠΠ²ΠΎΠΈΡΠ½ΡΠΉ ΡΡΠΌΠΌΠ°ΡΠΎΡ — ΡΡΠΎ ΡΠ»Π΅ΠΊΡΡΠΎΠ½Π½Π°Ρ Π»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠ°Ρ ΡΡ Π΅ΠΌΠ°, Π²ΡΠΏΠΎΠ»Π½ΡΡΡΠ°Ρ ΡΡΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΡΠΈΡΠ΅Π».
ΠΠΎ ΡΠΏΠΎΡΠΎΠ±Ρ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½ΠΈΡ ΠΈ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΠΈ ΡΠΊΠ»Π°Π΄ΡΠ²Π°Π΅ΠΌΡΡ ΡΠΈΡΠ΅Π» ΠΌΠ½ΠΎΠ³ΠΎΡΠ°Π·ΡΡΠ΄Π½ΡΠ΅ ΡΡΠΌΠΌΠ°ΡΠΎΡΡ ΠΏΠΎΠ΄ΡΠ°Π·Π΄Π΅Π»ΡΡΡΡΡ Π½Π°:
Β· ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°ΡΠ΅Π»ΡΠ½ΡΠ΅, Π² ΠΊΠΎΡΠΎΡΡΡ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΠ° ΡΠΈΡΠ΅Π» Π²Π΅Π΄ΡΡΡΡ ΠΏΠΎΠΎΡΠ΅ΡΡΠ΄Π½ΠΎ, ΡΠ°Π·ΡΡΠ΄ Π·Π° ΡΠ°Π·ΡΡΠ΄ΠΎΠΌ Π½Π° ΠΎΠ΄Π½ΠΎΠΌ ΠΈ ΡΠΎΠΌ ΠΆΠ΅ ΠΎΠ±ΠΎΡΡΠ΄ΠΎΠ²Π°Π½ΠΈΠΈ;
Β· ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΡΠ΅, Π² ΠΊΠΎΡΠΎΡΡΡ ΡΠ»Π°Π³Π°Π΅ΠΌΡΠ΅ ΡΠΊΠ»Π°Π΄ΡΠ²Π°ΡΡΡΡ ΠΎΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎ ΠΏΠΎ Π²ΡΠ΅ΠΌ ΡΠ°Π·ΡΡΠ΄Π°ΠΌ, ΠΈ Π΄Π»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΡΠ°Π·ΡΡΠ΄Π° ΠΈΠΌΠ΅Π΅ΡΡΡ ΡΠ²ΠΎΡ ΠΎΠ±ΠΎΡΡΠ΄ΠΎΠ²Π°Π½ΠΈΠ΅.
Π‘Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅ ΡΠΈΡΠ΅Π» Π² Π΄Π²ΠΎΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ ΡΡΠΈΡΠ»Π΅Π½ΠΈΡ ΠΏΠΎΠ΄ΠΎΠ±Π½ΠΎ ΡΡΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π² Π΄Π΅ΡΡΡΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅.
ΠΠ°ΠΊ ΡΠΎΠ»ΡΠΊΠΎ ΡΡΠΌΠΌΠ° ΡΠ°Π·ΡΡΠ΄ΠΎΠ² Π² Π΄Π΅ΡΡΡΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ ΡΡΠ°Π½ΠΎΠ²ΠΈΡΡΡ Π±ΠΎΠ»ΡΡΠ΅ ΠΈΠ»ΠΈ ΡΠ°Π²Π½ΠΎΠΉ 10 (ΠΎΡΠ½ΠΎΠ²Π°Π½ΠΈΡ ΡΠΈΡΡΠ΅ΠΌΡ ΡΡΠΈΡΠ»Π΅Π½ΠΈΡ) ΠΌΡ Π΄Π΅Π»Π°Π΅ΠΌ ΠΏΠ΅ΡΠ΅Π½ΠΎΡ Π² Π±ΠΎΠ»Π΅Π΅ ΡΡΠ°ΡΡΠΈΠΉ ΡΠ°Π·ΡΡΠ΄. Π’Π°ΠΊ ΠΈ Π² Π΄Π²ΠΎΠΈΡΠ½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅:
0+0=0;
0+1=1;
1+0=1;
1+1=0 ΠΈ ΠΏΠ΅ΡΠ΅Π½ΠΎΡ Π² ΡΡΠ°ΡΡΠΈΠΉ ΡΠ°Π·ΡΡΠ΄ 1. (1+1=2; 2=2 (ΠΎΡΠ½ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΈΡΡΠ΅ΠΌΡ); ΡΠΎΠ²Π΅ΡΡΠ°Π΅ΡΡΡ ΠΏΠ΅ΡΠ΅Π½ΠΎΡ Π² ΡΡΠ°ΡΡΠΈΠΉ ΡΠ°Π·ΡΡΠ΄).
1.2 Π¦Π΅Π»ΠΈ
1. ΠΠ°ΡΡΠΈΡΡΡΡ Π»ΡΡΡΠ΅ ΡΠ°Π±ΠΎΡΠ°ΡΡ ΡΠΎ ΡΡΠ΅Π΄ΠΎΠΉ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ Visual Studio 2012.
2. ΠΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΡΠ°Π·ΠΎΠ±ΡΠ°ΡΡΡΡ Π² Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡΡ ΡΠ·ΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ C#.
3. ΠΠΎΠ»ΡΡΠΈΡΡ Π·Π½Π°Π½ΠΈΡ, Π΄Π»Ρ Π΄Π°Π»ΡΠ½Π΅ΠΉΡΠ΅Π³ΠΎ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ Π½Π° Π΄Π°Π½Π½ΠΎΠΉ ΡΠΏΠ΅ΡΠΈΠ°Π»ΡΠ½ΠΎΡΡΠΈ
1.3 ΠΠ°Π΄Π°ΡΠΈ
1. ΠΠ·ΡΡΠΈΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ, ΠΊΠ°ΡΠ°ΡΡΡΡΡΡ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΡΡΠΌΠΌΠ°ΡΠΎΡΠΎΠ². ΠΠΎΠ½ΡΡΡ ΠΏΡΠΈΠ½ΡΠΈΠΏ ΠΈΡ ΡΠ°Π±ΠΎΡΡ.
2. Π‘ΠΎΠ·Π΄Π°ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ.
3. ΠΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ Π½Π° Π½Π°Π»ΠΈΡΠΈΠ΅ ΠΎΡΠΈΠ±ΠΎΠΊ.
2. Π ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅
2.1 ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Π΄Π²ΠΎΠΈΡΠ½ΡΠΉ ΡΡΠΌΠΌΠ°ΡΠΎΡ ΡΡΠΈΡΠ»Π΅Π½ΠΈΠ΅
ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅Ρ ΡΠΎΠ±ΠΎΠΉ ΠΎΠΊΠ½ΠΎ Ρ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ°ΠΌΠΈ windows forms. ΠΠΎΠ΄ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ ΡΠ·ΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ C#.
Π ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΏΡΠ΅Π΄ΡΡΠΌΠΎΡΡΠ΅Π½ΠΎ Π΄Π²Π° ΡΠ΅ΠΆΠΈΠΌΠ° ΡΠ°Π±ΠΎΡΡ: ΡΠ΅ΠΆΠΈΠΌ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ ΠΈ ΡΠ΅ΠΆΠΈΠΌ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ.
Π Π΅ΠΆΠΈΠΌ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ Π²ΠΊΠ»ΡΡΠ°Π΅Ρ Π² ΡΠ΅Π±Ρ ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΊΡΡΡ, Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΈΠΌΠΈΡΠ°ΡΠΎΡ ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°, Π° ΡΠ°ΠΊΠΆΠ΅ ΡΡΠΌΠΌΠ°ΡΠΎΡ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΠΊΠΎΠ΄ΠΎΠ² Ρ Π²ΡΠ²ΠΎΠ΄ΠΎΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΡ Π½Π° ΡΠΊΡΠ°Π½.
Π ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠΎΠΌ ΠΊΡΡΡΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΡΡ ΠΎΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΏΠΎΠ½ΡΡΠΈΡ, ΡΠ²ΡΠ·Π°Π½Π½ΡΠ΅ Ρ Π΄Π²ΠΎΠΈΡΠ½ΡΠΌΠΈ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°ΠΌΠΈ.
ΠΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΈΠΌΠΈΡΠ°ΡΠΎΡ ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ° ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅Ρ ΡΠΎΠ±ΠΎΠΉ Π°Π½ΠΈΠΌΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΡΡ Π΅ΠΌΡ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ° ΠΈ ΠΏΠΎΡΠ°Π³ΠΎΠ²ΡΠ΅ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ. Π‘Ρ Π΅ΠΌΠ° ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π° ΡΠ°ΠΊΠΈΠΌ ΠΎΠ±ΡΠ°Π·ΠΎΠΌ, ΡΡΠΎΠ±Ρ ΠΏΡΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΈ ΠΈΡΡ ΠΎΠ΄Π½ΡΡ Π΄Π°Π½Π½ΡΡ ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΠ»Π° ΡΠΌΠ΅Π½Π° Π²Π½Π΅ΡΠ½Π΅Π³ΠΎ Π²ΠΈΠ΄Π° ΡΡ Π΅ΠΌΡ ΠΈ Π°Π½ΠΈΠΌΠ°ΡΠΈΠΈ.
Π‘ΡΠΌΠΌΠ°ΡΠΎΡ Π΄Π²ΠΎΠΈΡΠ½ΡΡ ΠΊΠΎΠ΄ΠΎΠ² Ρ Π²ΡΠ²ΠΎΠ΄ΠΎΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΡ ΠΈΠΌΠΈΡΠΈΡΡΠ΅Ρ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ ΡΠ΅Π»ΠΎΠ²Π΅ΠΊΠ° ΠΏΡΠΈ Π²ΡΡΠΈΡΠ»Π΅Π½ΠΈΠΈ Π² ΡΡΠΎΠ»Π±ΠΈΠΊ.
Π Π΅ΠΆΠΈΠΌ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅Ρ ΡΠΎΠ±ΠΎΠΉ ΠΎΠΊΠ½ΠΎ Ρ ΡΠ΅ΡΡΡΡ ΠΏΡΠΈΠΌΠ΅ΡΠ°ΠΌΠΈ. ΠΠ»Ρ ΡΠΎΠ³ΠΎ, ΡΡΠΎΠ±Ρ Π½Π°ΡΠ°ΡΡ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°ΡΡΡΡ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ Π·Π°ΠΏΠΎΠ»Π½ΠΈΡΡ Π½ΡΠΆΠ½ΡΠ΅ ΠΏΠΎΠ»Ρ ΠΈ Π½Π°ΠΆΠ°ΡΡ ΠΊΠ½ΠΎΠΏΠΊΡ «Π½Π°ΡΠ°ΡΡ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅». ΠΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ, ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ ΠΊΠ»Π°ΡΡΠ° Random Π±ΡΠ΄ΡΡ ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π½Ρ ΡΠ΅ΡΡΡ Π·Π°Π΄Π°Π½ΠΈΠΉ. ΠΠΎΡΠ»Π΅ ΡΡΠΏΠ΅ΡΠ½ΠΎΠ³ΠΎ ΡΠ΅ΡΠ΅Π½ΠΈΡ ΠΈ Π²Π²ΠΎΠ΄Π° ΠΎΡΠ²Π΅ΡΠΎΠ² Π² ΡΠΎΡΠΌΡ, Π½ΡΠΆΠ½ΠΎ Π½Π°ΠΆΠ°ΡΡ «Π·Π°Π²Π΅ΡΡΠΈΡΡ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅», Π²ΡΠ»Π΅Π΄ΡΡΠ²ΠΈΠ΅ ΡΠ΅Π³ΠΎ ΠΏΠΎΡΠ²ΠΈΡΡΡ ΠΎΠΊΠ½ΠΎ Ρ ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ°ΠΌΠΈ. Π Π΅Π·ΡΠ»ΡΡΠ°ΡΡ ΡΠ°ΠΊΠΆΠ΅ Π±ΡΠ΄ΡΡ ΡΠΎΡ ΡΠ°Π½Π΅Π½Ρ Π² ΡΠ°ΠΉΠ».
ΠΠ°ΠΆΠ°Π² Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡ «ΡΠΏΡΠ°Π²ΠΊΠ°» ΠΌΠΎΠΆΠ½ΠΎ ΠΎΠ·Π½Π°ΠΊΠΎΠΌΠΈΡΡΡΡ Ρ ΠΊΡΠ°ΡΠΊΠΎΠΉ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠ΅ΠΉ ΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΈ Ρ ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠ°ΠΌΠΈ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΈ.
2.2 Π£ΠΊΡΡΠΏΠ½Π΅Π½Π½Π°Ρ ΡΡ Π΅ΠΌΠ° ΠΏΡΠΎΠ΅ΠΊΡΠ°
ΠΠ° ΡΠ»Π΅Π΄ΡΡΡΠ΅ΠΉ Π±Π»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ΅ ΠΏΡΠΎΠ΄Π΅ΠΌΠΎΠ½ΡΡΡΠΈΡΠΎΠ²Π°Π½Π° ΡΠ°Π±ΠΎΡΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ. (ΡΡ Π΅ΠΌΠ° 1).
2.3 ΠΠ½ΡΠ΅ΡΡΠ΅ΠΉΡ ΠΏΡΠΎΠ΅ΠΊΡΠ° ΠΈ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅
ΠΠ° Π³Π»Π°Π²Π½ΠΎΠΉ ΡΠΎΡΠΌΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΠ° ΡΠ°ΡΠΏΠΎΠ»ΠΎΠΆΠ΅Π½Ρ: Π΄Π²ΠΎΠΈΡΠ½ΡΠΉ ΡΡΠΌΠΌΠ°ΡΠΎΡ Ρ Π²ΡΠ²ΠΎΠ΄ΠΎΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΡ (ΡΠ»Π΅Π²Π°), ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΡΠ°ΡΡΡ (ΡΠΏΡΠ°Π²Π°), ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΎΠ΅ ΠΌΠ΅Π½Ρ (ΡΠ²Π΅ΡΡ Ρ).
Π ΠΈΡΡΠ½ΠΎΠΊ 1 — Π³Π»Π°Π²Π½Π°Ρ ΡΠΎΡΠΌΠ° Π ΠΈΡΡΠ½ΠΎΠΊ 2 — ΡΠ΅ΠΆΠΈΠΌ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ Π ΡΠ΅ΠΆΠΈΠΌΠ΅ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΡΠΈΠΌΠ΅ΡΡ Π½Π΅ ΠΏΠΎΡΠ²Π»ΡΡΡΡΡ Π΄ΠΎ ΡΠ΅Ρ ΠΏΠΎΡ, ΠΏΠΎΠΊΠ° ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ Π½Π΅ Π²Π²Π΅Π΄Π΅Ρ Π΄Π°Π½Π½ΡΠ΅ Π² ΠΏΠΎΠ»Ρ «Π€.Π.Π.» ΠΈ «ΠΡΡΠΏΠΏΠ°». ΠΡΠΈ Π·Π°ΠΏΡΡΠ΅Π½Π½ΠΎΠΌ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ, Π»ΡΠ±Π°Ρ ΠΏΠΎΠΏΡΡΠΊΠ° Π·Π°ΠΊΡΡΡΡ ΡΠΎΡΠΌΡ ΠΏΡΠΈΡΠ°Π²Π½ΠΈΠ²Π°Π΅ΡΡΡ ΠΊ Π½Π°ΠΆΠ°ΡΠΈΡ ΠΊΠ½ΠΎΠΏΠΊΠΈ «Π·Π°Π²Π΅ΡΡΠΈΡΡ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅», ΠΎ ΡΠ΅ΠΌ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ Π½Π° ΡΠ°ΠΌΠΎΠΉ ΡΠΎΡΠΌΠ΅. (Π ΠΈΡ. 2)
ΠΡΠΈ Π·Π°ΠΏΡΡΠΊΠ΅ Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ ΠΈΠΌΠΈΡΠ°ΡΠΎΡΠ° ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ° ΠΎΡΠΊΡΡΠ²Π°Π΅ΡΡΡ Π½ΠΎΠ²Π°Ρ ΡΠΎΡΠΌΠ° (ΡΠΈΡ. 3). Π§ΡΠΎΠ±Ρ Π½Π°ΡΠ°ΡΡ Π΄Π΅ΠΌΠΎΠ½ΡΡΡΠ°ΡΠΈΡ ΡΠ°Π±ΠΎΡΡ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π²Π²Π΅ΡΡΠΈ ΠΈΡΡ ΠΎΠ΄Π½ΡΠ΅ Π΄Π°Π½Π½ΡΠ΅ Π² ΡΠΏΠ΅ΡΠΈΠ°Π»ΡΠ½ΡΠ΅ ΠΏΠΎΠ»Ρ ΠΈ Π½Π°ΠΆΠ°ΡΡ ΠΊΠ½ΠΎΠΏΠΊΡ «Π½Π°ΡΠ°ΡΡ Π΄Π΅ΠΌΠΎΠ½ΡΡΡΠ°ΡΠΈΡ».
ΠΠ°Π½Π½ΡΠΉ ΠΈΠΌΠΈΡΠ°ΡΠΎΡ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ° ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΡΡΡΠ΅ Π²Ρ ΠΎΠ΄Π° Π΄Π°Π½Π½ΡΡ . ΠΡΠΎ ΡΠ΄Π΅Π»Π°Π½ΠΎ ΠΈΠ· ΡΠΎΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ ΡΠΎΠ³ΠΎ, ΡΡΠΎ ΡΠ΅ΡΡΡΠ΅Ρ Π²Ρ ΠΎΠ΄ΠΎΠ² Π±ΡΠ΄Π΅Ρ Π²ΠΏΠΎΠ»Π½Π΅ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ Π΄Π»Ρ Π΄Π΅ΠΌΠΎΠ½ΡΡΡΠ°ΡΠΈΠΈ ΡΠ°Π±ΠΎΡΡ ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°.
Π ΠΈΡΡΠ½ΠΎΠΊ 3 — Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠ°Ρ ΡΡ Π΅ΠΌΠ° ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°.
Π ΠΈΡΡΠ½ΠΎΠΊ 4 — ΡΠΏΡΠ°Π²ΠΊΠ° Π ΡΠΏΡΠ°Π²ΠΊΠ΅ ΠΎΡΠ²Π΅ΡΠ΅Π½Ρ ΠΎΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΌΠΎΠΌΠ΅Π½ΡΡ Π² ΡΠ°Π±ΠΎΡΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ. ΠΠΈΠΆΠ΅ Π½Π°Ρ ΠΎΠ΄ΠΈΡΡΡ ΡΠΏΠΈΡΠΎΠΊ ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠΎΠ² ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΈ Π΄Π»Ρ ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ ΠΊΡΡΡΠ°. (ΡΠΈΡ. 4)
3. Π’Π΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅
ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Π±ΡΠ»Π° ΠΏΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½Π° Π½Π° Π½Π°Π»ΠΈΡΠΈΠ΅ ΠΎΡΠΈΠ±ΠΎΠΊ ΠΈ Π½Π΅ΠΈΡΠΏΡΠ°Π²Π½ΠΎΡΡΠ΅ΠΉ ΠΌΠΎΠΈΠΌΠΈ ΠΎΠ΄Π½ΠΎΠ³ΡΡΠΏΠΏΠ½ΠΈΠΊΠ°ΠΌΠΈ. ΠΡΡΠ²Π»Π΅Π½Π½ΡΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ Π±ΡΠ»ΠΈ ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½Ρ. ΠΠ° Π΄Π°Π½Π½ΡΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π³ΠΎΡΠΎΠ²ΠΎ ΠΊ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ.
ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅
ΠΈ Π²Π²ΠΎΠ΄Ρ
Π ΡΠ²ΠΎΠ΅ΠΉ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΠ΅, Ρ ΠΏΠΎΡΡΠ°ΡΠ°Π»ΡΡ ΡΠ΄Π΅Π»Π°ΡΡ ΠΏΡΠΎΡΡΡΡ, ΡΠ΄ΠΎΠ±Π½ΡΡ Π² ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ. Π‘ΠΎΠ²ΠΎΠΊΡΠΏΠ½ΠΎΡΡΡ ΡΡΠ΅Π΄ΡΡΠ², ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½Π½ΡΡ ΠΌΠ½ΠΎΡ, Π²ΠΏΠΎΠ»Π½Π΅ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ Π΄Π»Ρ ΠΏΠΎΠ½ΠΈΠΌΠ°Π½ΠΈΡ ΡΠ΅ΠΌΡ, ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½Π½ΠΎΠΉ Π² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅.
Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° Π΄Π°Π½Π½ΠΎΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΏΠΎΠ·Π²ΠΎΠ»ΠΈΠ»Π° ΠΌΠ½Π΅ Π±ΠΎΠ»Π΅Π΅ ΡΠ³Π»ΡΠ±Π»Π΅Π½Π½ΠΎ ΠΈΠ·ΡΡΠΈΡΡ ΡΠΎΠ½ΠΊΠΎΡΡΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π½Π° C#.
1 Π’. Π. ΠΠ°Π²Π»ΠΎΠ²ΡΠΊΠ°Ρ ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π½Π° ΡΠ·ΡΠΊΠ΅ Π²ΡΡΠΎΠΊΠΎΠ³ΠΎ ΡΡΠΎΠ²Π½Ρ: ΡΡΠ΅Π±. ΠΏΠΎΡΠΎΠ±ΠΈΠ΅ /ΠΠΠ’ΠΠ , 2007. — 427 Ρ.
2 msdn.microsoft.com [ΠΠ»Π΅ΠΊΡΡΠΎΠ½Π½ΡΠΉ ΡΠ΅ΡΡΡΡ]: ΠΈΠ½ΡΠ΅ΡΠ½Π΅Ρ — ΠΏΠΎΡΡΠ°Π».
3 Chipnews.ru [ΠΠ»Π΅ΠΊΡΡΠΎΠ½Π½ΡΠΉ ΡΠ΅ΡΡΡΡ]: ΠΈΠ½ΡΠ΅ΡΠ½Π΅Ρ — ΠΆΡΡΠ½Π°Π». — Π. — Π Π΅ΠΆΠΈΠΌ Π΄ΠΎΡΡΡΠΏΠ°: http://www.chipnews.ru/html.cgi/arhiv/0002/stat-37.htm
ΠΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π
ΠΠΈΡΡΠΈΠ½Π³ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ
ΠΠ»Π°Π²Π½Π°Ρ ΡΠΎΡΠΌΠ° (ΡΠ΅ΠΆΠΈΠΌ ΠΎΠ±ΡΡΠ΅Π½ΠΈΡ)
using System;
using System. Collections. Generic;
using System. ComponentModel;
using System. Data;
using System. Drawing;
using System. Linq;
using System. Text;
using System. Windows. Forms;
namespace WindowsFormsApplication4
{
public partial class Form1: Form
{
public Form1 ()
{
InitializeComponent ();
}
Form2 f2 = new Form2 ();
Form3 f3 = new Form3 ();
Form4 f4 = new Form4 ();
private void Π²ΡΡ ΠΎΠ΄ToolStripMenuItem_Click (object sender, EventArgs e)
{
Close ();
}
private void button1_Click (object sender, EventArgs e)
{
try
{
label2. Text = ««;
label3. Text = ««;
string TB1 = ««, TB2 = ««, otv = ««;
int deistv = 0;
int Max = Math. Max (textBox1. Text. Length, textBox2. Text. Length);
int NULL = Math. Abs (textBox1. Text. Length — textBox2. Text. Length);
int[] ost = new int [Max + 1];
int[] x = new int [Max + 1];
int[] y = new int [Max + 1];
int[] otvet = new int [Max + 1];
for (int i = 0; i < NULL; i++)
if (textBox1. Text. Length > textBox2. Text. Length)
TB2 += 0;
else
TB1 += 0;
TB1 += textBox1. Text;
TB2 += textBox2. Text;
for (int i = Max; i > 0; i-)
{
x[i] = TB1 [i — 1] - 48;
y[i] = TB2 [i — 1] - 48;
ost[i] = 0;
}
label3. Text = «0″ + TB1 + „n+n“ +» 0″ + TB2;
for (int i = Max; i >= 0; i-)
(
deistv++; label2. Text += «n» + deistv +")";
if (x[i] == 1 && y[i] == 1) if (ost[i] == 0) {ost [i — 1] = 1; otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «=» + ost [i — 1] + «0″; } else {ost [i — 1] = 1; otvet[i] = 1; label2. Text += x[i] + „+“ + y[i] + „+ΠΎΡΡΠ°ΡΠΎΠΊ:“ + ost[i] + „=“ + otvet[i] +» «+ ost [i — 1]; }
else if (x[i] == 0 && y[i] == 1 || x[i] == 1 && y[i] == 0) if (ost[i] == 0) {otvet[i] = 1; label2. Text += x[i] + «+» + y[i] + «=» + otvet[i]; } else {ost [i — 1] = 1; otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «+ ΠΎΡΡΠ°ΡΠΎΠΊ:» + ost[i] + «=» + ost [i — 1] +" «+ otvet[i]; }
else if (x[i] == 0 && y[i] == 0) if (ost[i] == 0) {otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «=» + otvet[i]; } else {otvet[i] = 1; label2. Text += x[i] + «+» + y[i] + «+ ΠΎΡΡΠ°ΡΠΎΠΊ:» + ost[i] + «=» + otvet[i]; }
}
int bb = Max + 1;
for (int i = 0; i <= Max; i++)
otv += otvet[i]; label2. Text += «nΠΎΡΠ²Π΅Ρ:» + otv;
if (otv[0] == '0') otv = otv. Remove (0, 1);
textBox3. Text = otv;
}
catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π½ΠΎΠ΅ ΠΈΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅»);}
}
private void textBox1_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar==(char) Keys. D0||e. KeyChar==(char) Keys. D1|| (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
if (e. KeyChar == (char) Keys. Enter) button1. Focus ();
}
private void textBox2_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
if (e. KeyChar == (char) Keys. Enter) button1. Focus ();
}
private void ΡΠ΅ΠΆΠΈΠΌΠΡΠΎΠ²Π΅ΡΠΊΠΈΠΠ½Π°Π½ΠΈΠΉToolStripMenuItem_Click (object sender, EventArgs e)
{
panel4. Visible = false;
f2. ShowDialog ();
}
private void ΡΠ°ΠΉΠ»ToolStripMenuItem_Click (object sender, EventArgs e)
{
Close ();
}
private void ΡΠΏΡΠ°Π²ΠΊΠ°ToolStripMenuItem_Click (object sender, EventArgs e)
{
f3. ShowDialog ();
}
private void button3_Click (object sender, EventArgs e)
{
f4. ShowDialog ();
}
private void Form1_Activated (object sender, EventArgs e)
{
panel4. Visible = true;
}
private void button2_Click1 (object sender, EventArgs e)
{
f2. ShowDialog ();
}
}
}
Π Π΅ΠΆΠΈΠΌ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ
using System;
using System. Collections. Generic;
using System. ComponentModel;
using System. Data;
using System. Drawing;
using System. Linq;
using System. Text;
using System. Windows. Forms;
using System. IO;
namespace WindowsFormsApplication4
{
public partial class Form2: Form
{
public Form2 ()
{
InitializeComponent ();
}
string C = «5», C2= «5», C3= «5», C4= «5», C5= «5», C6= «5»;
private void button1_Click (object sender, EventArgs e)
{
try
{
if (textBox4. Text. Trim () == ««) MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡΠ΅ Π€.Π.Π.»);
else
if (textBox5. Text. Trim () == ««) MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡΠ΅ Π³ΡΡΠΏΠΏΡ»);
else
{
groupBox1. Enabled = true;
textBox4. Enabled = false;
textBox5. Enabled = false;
button1. Enabled = false;
label2. Enabled = false;
label3. Enabled = false;
panel1. Visible = true;
panel2. Visible = true;
panel3. Visible = true;
panel4. Visible = true;
panel5. Visible = true;
panel6. Visible = true;
label10. Visible = true;
label11. Visible = true;
label12. Visible = true;
label13. Visible = true;
label13. Visible = true;
label14. Visible = true;
label15. Visible = true;
Random random = new Random ();
int a = random. Next (0, 100);
int b = random. Next (0, 100);
C = Convert. ToString (a + b, 2);
string value1 = Convert. ToString (a, 2);
string value2 = Convert. ToString (b, 2);
label5. Text = value1 + «n+n» + value2;
a = random. Next (0, 100);
b = random. Next (0, 100);
C2 = Convert. ToString (a + b, 2);
value1 = Convert. ToString (a, 2);
value2 = Convert. ToString (b, 2);
label6. Text = value1 + «n+n» + value2;
a = random. Next (0, 100);
b = random. Next (0, 100);
C3 = Convert. ToString (a + b, 2);
value1 = Convert. ToString (a, 2);
value2 = Convert. ToString (b, 2);
label7. Text = value1 + «n+n» + value2;
a = random. Next (0, 100);
b = random. Next (0, 100);
C4 = Convert. ToString (a + b, 2);
value1 = Convert. ToString (a, 2);
value2 = Convert. ToString (b, 2);
label1. Text = value1 + «n+n» + value2;
a = random. Next (0, 100);
b = random. Next (0, 100);
C5 = Convert. ToString (a + b, 2);
value1 = Convert. ToString (a, 2);
value2 = Convert. ToString (b, 2);
label4. Text = value1 + «n+n» + value2;
a = random. Next (0, 100);
b = random. Next (0, 100);
C6 = Convert. ToString (a + b, 2);
value1 = Convert. ToString (a, 2);
value2 = Convert. ToString (b, 2);
label8. Text = value1 + «n+n» + value2;
}
}
catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π°Ρ ΠΎΡΠΈΠ±ΠΊΠ°»);}
}
private void button2_Click (object sender, EventArgs e)
{
Close ();
}
private void textBox1_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox2_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox3_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void Form2_FormClosed (object sender, FormClosedEventArgs e)
{
try {
if (groupBox1. Enabled)
{
StreamWriter f = new StreamWriter (textBox5. Text + «» + textBox4. Text +". txt");
int verno = 0;
int ocenka = 0;
string errors = ««;
if (textBox1. Text == C) verno++; else errors += «1»;
if (textBox2. Text == C2) verno++; else errors += «2»;
if (textBox3. Text == C3) verno++; else errors += «3»;
if (textBox6. Text == C4) verno++; else errors += «4»;
if (textBox7. Text == C5) verno++; else errors += «5»;
if (textBox8. Text == C6) verno++; else errors += «6»;
f. WriteLine («ΡΡΠ°ΡΠΈΠΉΡΡ (ΡΡΡ):» + textBox4. Text);
f. WriteLine («Π³ΡΡΠΏΠΏΠ°:» + textBox5. Text);
f. WriteLine («Π΄Π°Π½ΠΎ Π²Π΅ΡΠ½ΡΡ ΠΎΡΠ²Π΅ΡΠΎΠ²:» + verno);
f. WriteLine («ΠΎΡΠΈΠ±ΠΊΠΈ Π² Π½ΠΎΠΌΠ΅ΡΠ°Ρ :» + errors);
switch (verno)
{
case 6: ocenka = 5; break;
case 5: ocenka = 4; break;
case 4: ocenka = 4; break;
case 3: ocenka = 3; break;
case 2: ocenka = 2; break;
case 1: ocenka = 2; break;
case 0: ocenka = 2; break;
}
if (verno == 6) MessageBox. Show («Π²Π΅ΡΠ½ΠΎ ΠΎΡΠ²Π΅ΡΠΎΠ² Π΄Π°Π½ΠΎ:» + verno + «n ΠΎΡΠ΅Π½ΠΊΠ°:» + ocenka);
else
MessageBox. Show («Π²Π΅ΡΠ½ΠΎ ΠΎΡΠ²Π΅ΡΠΎΠ² Π΄Π°Π½ΠΎ:» + verno + «n ΠΎΡΠ΅Π½ΠΊΠ°:» + ocenka + «n ΠΎΡΠΈΠ±ΠΊΠΈ Π² Π½ΠΎΠΌΠ΅ΡΠ°Ρ :» + errors);
f. WriteLine («ΠΎΡΠ΅Π½ΠΊΠ°:» + ocenka);
f. Close ();
Close ();
groupBox1. Enabled = false;
textBox4. Enabled = true;
textBox5. Enabled = true;
button1. Enabled = true;
label2. Enabled = true;
label3. Enabled = true;
label5. Text = ««;
label6. Text = ««;
label7. Text = ««;
label1. Text = ««;
label4. Text = ««;
label8. Text = ««;
textBox1. Text = ««;
textBox2. Text = ««;
textBox3. Text = ««;
textBox4. Text = ««;
textBox5. Text = ««;
textBox6. Text = ««;
textBox7. Text = ««;
textBox8. Text = ««;
panel1. Visible = false;
panel2. Visible = false;
panel3. Visible = false;
panel4. Visible = false;
panel5. Visible = false;
panel6. Visible = false;
label10. Visible = false;
label11. Visible = false;
label12. Visible = false;
label13. Visible = false;
label13. Visible = false;
label14. Visible = false;
label15. Visible = false;
}
else
{
textBox4. Text = ««;
textBox5. Text = ««;
}
} catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π½ΠΎΠ΅ ΠΈΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅»);}
}
private void textBox6_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}
else e. Handled = true;
}
private void textBox7_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}
else e. Handled = true;
}
private void textBox8_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}
else e. Handled = true;
}
}
}
ΠΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΈΠΌΠΈΡΠ°ΡΠΎΡ ΠΏΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡΠ½ΠΎΠ³ΠΎ ΡΡΠΌΠΌΠ°ΡΠΎΡΠ°
using System;
using System. Collections. Generic;
using System. ComponentModel;
using System. Data;
using System. Drawing;
using System. Linq;
using System. Text;
using System. Windows. Forms;
namespace WindowsFormsApplication4
{
public partial class Form4: Form
{
public Form4 ()
{
InitializeComponent ();
}
private void button1_Click (object sender, EventArgs e)
{
rectangleShape1. BackColor = Color. LimeGreen;
rectangleShape3. BackColor = Color. LimeGreen;
rectangleShape5. BackColor = Color. LimeGreen;
rectangleShape2. BackColor = Color. Red;
rectangleShape4. BackColor = Color. Red;
rectangleShape6. BackColor = Color. Red;
label1. BackColor = Color. LimeGreen;
label2. BackColor = Color. LimeGreen;
label3. BackColor = Color. LimeGreen;
label4. BackColor = Color. Red;
label5. BackColor = Color. Red;
label6. BackColor = Color. Red;
groupBox2. Visible = true;
button1. Enabled = false;
label27. Visible = true;
}
private void button4_Click (object sender, EventArgs e)
{
if (textBox1. Text. Length == 1 && textBox2. Text. Length == 1 && textBox3. Text. Length == 1 && textBox4. Text. Length == 1 && textBox5. Text. Length == 1 && textBox6. Text. Length == 1)
{
groupBox1. Visible = true;
groupBox1. Visible = true;
label14. Text = textBox1. Text;
label15. Text = textBox4. Text;
label16. Text = textBox2. Text;
label17. Text = textBox5. Text;
label18. Text = textBox3. Text;
label19. Text = textBox6. Text;
lineShape10. BorderColor = Color. Red;
lineShape9. BorderColor = Color. Red;
lineShape8. BorderColor = Color. Red;
lineShape11. BorderColor = Color. Red;
lineShape12. BorderColor = Color. Red;
lineShape13. BorderColor = Color. Red;
lineShape14. BorderColor = Color. Red;
lineShape15. BorderColor = Color. Red;
lineShape16. BorderColor = Color. Red;
lineShape17. BorderColor = Color. Red;
lineShape18. BorderColor = Color. Red;
lineShape21. BorderColor = Color. Red;
lineShape22. BorderColor = Color. Red;
lineShape25. BorderColor = Color. Red;
lineShape26. BorderColor = Color. Red;
lineShape6. BorderColor = Color. Black;
lineShape49. BorderColor = Color. Black;
lineShape38. BorderColor = Color. Black;
lineShape39. BorderColor = Color. Black;
lineShape40. BorderColor = Color. Black;
lineShape2. BorderColor = Color. Black;
lineShape4. BorderColor = Color. Black;
lineShape35. BorderColor = Color. Black;
lineShape36. BorderColor = Color. Black;
lineShape37. BorderColor = Color. Black;
button3. Enabled = false;
button5. Enabled = false;
groupBox4. Visible = false;
label20. Text= «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
label21. Text= «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
label22. Text = «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
if (label14. Text == «1») lineShape19. BorderColor = Color. LimeGreen; else lineShape19. BorderColor = Color. Red;
if (label15. Text == «1») lineShape20. BorderColor = Color. LimeGreen; else lineShape20. BorderColor = Color. Red;
if (label16. Text == «1») lineShape24. BorderColor = Color. LimeGreen; else lineShape24. BorderColor = Color. Red;
if (label17. Text == «1») lineShape23. BorderColor = Color. LimeGreen; else lineShape23. BorderColor = Color. Red;
if (label18. Text == «1») lineShape28. BorderColor = Color. LimeGreen; else lineShape28. BorderColor = Color. Red;
if (label19. Text == «1») lineShape27. BorderColor = Color. LimeGreen; else lineShape27. BorderColor = Color. Red;
lineShape41. BorderColor = Color. IndianRed; lineShape42. BorderColor = Color. IndianRed; lineShape43. BorderColor = Color. IndianRed; lineShape44. BorderColor = Color. IndianRed;
lineShape45. BorderColor = Color. IndianRed; lineShape48. BorderColor = Color. IndianRed; lineShape47. BorderColor = Color. IndianRed; lineShape46. BorderColor = Color. IndianRed;
button1. Enabled = true;
button2. Enabled = true;
groupBox2. Visible = false;
groupBox3. Visible = false;
label27. Visible = false;
}
else MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡΠ΅ Π²ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ Π²Ρ ΠΎΠ΄ΠΎΠ²»);
}
int schot = 0;
private void button2_Click (object sender, EventArgs e)
{
lineShape41. BorderColor = Color. Green; lineShape42. BorderColor = Color. Green; lineShape43. BorderColor = Color. Green; lineShape44. BorderColor = Color. Green;
if (label14. Text == «1») {lineShape17. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; rectangleShape1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape2. BackColor = Color. Red;}} else {label20. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape10. BorderColor = Color. Red; lineShape9. BorderColor = Color. Red; lineShape8. BorderColor = Color. Red;}
if (label16. Text == «1») {lineShape21. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape13. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; rectangleShape3. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape4. BackColor = Color. Red;}} else {label21. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape11. BorderColor = Color. Red; lineShape12. BorderColor = Color. Red; lineShape13. BorderColor = Color. Red;}
if (label18. Text == «1») {lineShape25. BorderColor = Color. LimeGreen; lineShape14. BorderColor = Color. LimeGreen; lineShape16. BorderColor = Color. LimeGreen; lineShape15. BorderColor = Color. LimeGreen; label22. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label3. BackColor == Color. LimeGreen) {label3. BackColor = Color. Red; rectangleShape5. BackColor = Color. Red; label6. BackColor = Color. LimeGreen; rectangleShape6. BackColor = Color. LimeGreen;} else {label3. BackColor = Color. LimeGreen; rectangleShape5. BackColor = Color. LimeGreen; label6. BackColor = Color. Red; rectangleShape6. BackColor = Color. Red;}} else {label22. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape14. BorderColor = Color. Red; lineShape16. BorderColor = Color. Red; lineShape15. BorderColor = Color. Red;}
timer2. Enabled = true;
groupBox3. Visible = true;
button2. Enabled = false;
}
private void timer2_Tick (object sender, EventArgs e)
{
switch (schot)
{
case 1: {lineShape19. BorderWidth = 5; lineShape24. BorderWidth = 5; lineShape28. BorderWidth = 5; break;}
case 2: {lineShape19. BorderWidth = 3; lineShape24. BorderWidth = 3; lineShape28. BorderWidth = 3; rectangleShape10. BorderWidth = 5; rectangleShape12. BorderWidth = 5; rectangleShape14. BorderWidth = 5; break;}
case 3: {rectangleShape10. BorderWidth = 1; rectangleShape12. BorderWidth = 1; rectangleShape14. BorderWidth = 1; lineShape17. BorderWidth = 5; lineShape21. BorderWidth = 5; lineShape25. BorderWidth = 5; break;}
case 4: {lineShape17. BorderWidth = 2; lineShape21. BorderWidth = 2; lineShape25. BorderWidth = 2; rectangleShape7. BorderWidth = 5; rectangleShape8. BorderWidth = 5; rectangleShape9. BorderWidth = 5; break;}
case 5: {rectangleShape7. BorderWidth = 1; rectangleShape8. BorderWidth = 1; rectangleShape9. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; lineShape8. BorderWidth = 5; lineShape13. BorderWidth = 5; lineShape12. BorderWidth = 5; lineShape11. BorderWidth = 5; lineShape14. BorderWidth = 5; lineShape16. BorderWidth = 5; lineShape15. BorderWidth = 5; label20. Visible = true; label21. Visible = true; label22. Visible = true; break;}
case 6: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; schot = 0; button3. Enabled = true; timer2. Enabled = false; break;}
}
schot++;
}
private void button3_Click (object sender, EventArgs e)
{
timer3. Enabled = true;
lineShape45. BorderColor = Color. Green; lineShape48. BorderColor = Color. Green; lineShape47. BorderColor = Color. Green; lineShape46. BorderColor = Color. Green;
if (label15. Text == «1») {lineShape18. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; rectangleShape1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape2. BackColor = Color. Red;}} else {label20. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape10. BorderColor = Color. Red; lineShape9. BorderColor = Color. Red; lineShape8. BorderColor = Color. Red;}
if (label17. Text == «1») {lineShape22. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape13. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; rectangleShape3. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape4. BackColor = Color. Red;}} else {label21. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape11. BorderColor = Color. Red; lineShape12. BorderColor = Color. Red; lineShape13. BorderColor = Color. Red;}
if (label19. Text == «1») {lineShape26. BorderColor = Color. LimeGreen; lineShape14. BorderColor = Color. LimeGreen; lineShape16. BorderColor = Color. LimeGreen; lineShape15. BorderColor = Color. LimeGreen; label22. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; if (label3. BackColor == Color. LimeGreen) {label3. BackColor = Color. Red; rectangleShape5. BackColor = Color. Red; label6. BackColor = Color. LimeGreen; rectangleShape6. BackColor = Color. LimeGreen;} else {label3. BackColor = Color. LimeGreen; rectangleShape5. BackColor = Color. LimeGreen; label6. BackColor = Color. Red; rectangleShape6. BackColor = Color. Red;}} else {label22. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape14. BorderColor = Color. Red; lineShape16. BorderColor = Color. Red; lineShape15. BorderColor = Color. Red;}
button3. Enabled = false;
groupBox4. Visible = true;
}
private void timer3_Tick (object sender, EventArgs e)
{
switch (schot)
{
case 1: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; lineShape20. BorderWidth = 5; lineShape23. BorderWidth = 5; lineShape27. BorderWidth = 5; break;}
case 2: {lineShape20. BorderWidth = 2; lineShape23. BorderWidth = 2; lineShape27. BorderWidth = 2; rectangleShape11. BorderWidth = 5; rectangleShape13. BorderWidth = 5; rectangleShape15. BorderWidth = 5; break;}
case 3: {rectangleShape11. BorderWidth = 1; rectangleShape13. BorderWidth = 1; rectangleShape15. BorderWidth = 1; lineShape18. BorderWidth = 5; lineShape22. BorderWidth = 5; lineShape26. BorderWidth = 5; break;}
case 4: {lineShape18. BorderWidth = 2; lineShape22. BorderWidth = 2; lineShape26. BorderWidth = 2; rectangleShape7. BorderWidth = 5; rectangleShape8. BorderWidth = 5; rectangleShape9. BorderWidth = 5; break;}
case 5: {rectangleShape7. BorderWidth = 1; rectangleShape8. BorderWidth = 1; rectangleShape9. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; lineShape8. BorderWidth = 5; lineShape13. BorderWidth = 5; lineShape12. BorderWidth = 5; lineShape11. BorderWidth = 5; lineShape14. BorderWidth = 5; lineShape16. BorderWidth = 5; lineShape15. BorderWidth = 5; label20. Visible = true; label21. Visible = true; label22. Visible = true; break;}
case 6: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; break;}
case 7: {timer1. Enabled = false; schot = 0; button5. Enabled = true; timer3. Enabled = false; break;}
}
schot++;
}
private void textBox1_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox2_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox3_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox4_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox5_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
private void textBox6_KeyPress (object sender, KeyPressEventArgs e)
{
if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡΠ΅Ρ Π²Π²ΠΎΠ΄Π° Π²ΡΠ΅Π³ΠΎ, ΠΊΡΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π1
else e. Handled = true;
}
int schot2 = 0;
private void timer4_Tick (object sender, EventArgs e) //
{
schot2++;
switch (schot2)
{
case 1: {lineShape6. BorderWidth = 5; break;}
case 2: {lineShape6. BorderWidth = 2; lineShape49. BorderWidth = 5; break;}
case 3: {lineShape49. BorderWidth = 2; rectangleShape18. BorderWidth = 5; break;}
case 4: {rectangleShape18. BorderWidth = 1; lineShape38. BorderWidth = 5; break;}
case 5: {lineShape38. BorderWidth = 2; lineShape39. BorderWidth = 5; break;}
case 6: {lineShape39. BorderWidth = 2; lineShape40. BorderWidth = 5; break;}
case 7: {lineShape40. BorderWidth = 2; rectangleShape8. BorderWidth = 5; break;}
case 8: {rectangleShape8. BorderWidth = 1; lineShape11. BorderWidth = 5; lineShape12. BorderWidth = 5; label21. Visible = true; lineShape13. BorderWidth = 5; break;}
case 9: {lineShape11. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape13. BorderWidth = 2; label21. Visible = false; schot2 = 0; timer4. Enabled = false; break;}
}
}
private void button5_Click (object sender, EventArgs e)
{
button5. Enabled = false;
if (label18. Text == «1» && label19. Text == «1») {timer4. Enabled = true; lineShape6. BorderColor = Color. LimeGreen; lineShape49. BorderColor = Color. LimeGreen; lineShape38. BorderColor = Color. LimeGreen; lineShape39. BorderColor = Color. LimeGreen; lineShape40. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; lineShape13. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. Red; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape3. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. Red;}}
if (label16. Text == «1» && label17. Text == «1») {timer5. Enabled = true; lineShape37. BorderColor = Color. LimeGreen; lineShape36. BorderColor = Color. LimeGreen; lineShape35. BorderColor = Color. LimeGreen; lineShape4. BorderColor = Color. LimeGreen; lineShape2. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° ΡΡΠΈΠ³Π³Π΅ΡΠ°»; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. Red; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape1. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. Red;}}
}
int schot3 = 0;
private void timer5_Tick (object sender, EventArgs e)
{
schot3++;
switch (schot3)
{
case 1: {lineShape2. BorderWidth = 5; break;}
case 2: {lineShape2. BorderWidth = 2; lineShape4. BorderWidth = 5; break;}
case 3: {lineShape4. BorderWidth = 2; rectangleShape16. BorderWidth = 5; break;}
case 4: {rectangleShape16. BorderWidth = 1; lineShape35. BorderWidth = 5; break;}
case 5: {lineShape35. BorderWidth = 2; lineShape36. BorderWidth = 5; break;}
case 6: {lineShape36. BorderWidth = 2; lineShape37. BorderWidth = 5; break;}
case 7: {lineShape37. BorderWidth = 2; rectangleShape7. BorderWidth = 5; break;}
case 8: {rectangleShape7. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; label20. Visible = true; lineShape8. BorderWidth = 5; break;}
case 9: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; label20. Visible = false; schot3 = 0; timer5. Enabled = false; break;}
}
}
private void Form4_FormClosed (object sender, FormClosedEventArgs e)
{
groupBox1. Visible = false;
textBox2. Text = ««;
textBox3. Text = ««;
textBox6. Text = ««;
textBox5. Text = ««;
timer1. Enabled = false;
timer2. Enabled = false;
timer3. Enabled = false;
timer4. Enabled = false;
timer5. Enabled = false;
schot = 0;
schot2 = 0;
schot3 = 0;
label14. Text = textBox1. Text;
label15. Text = textBox4. Text;
label16. Text = textBox2. Text;
label17. Text = textBox5. Text;
label18. Text = textBox3. Text;
label19. Text = textBox6. Text;
lineShape10. BorderColor = Color. Red;
lineShape9. BorderColor = Color. Red;
lineShape8. BorderColor = Color. Red;
lineShape11. BorderColor = Color. Red;
lineShape12. BorderColor = Color. Red;
lineShape13. BorderColor = Color. Red;
lineShape14. BorderColor = Color. Red;
lineShape15. BorderColor = Color. Red;
lineShape16. BorderColor = Color. Red;
lineShape17. BorderColor = Color. Red;
lineShape18. BorderColor = Color. Red;
lineShape21. BorderColor = Color. Red;
lineShape22. BorderColor = Color. Red;
lineShape25. BorderColor = Color. Red;
lineShape26. BorderColor = Color. Red;
lineShape6. BorderColor = Color. Black;
lineShape49. BorderColor = Color. Black;
lineShape38. BorderColor = Color. Black;
lineShape39. BorderColor = Color. Black;
lineShape40. BorderColor = Color. Black;
lineShape2. BorderColor = Color. Black;
lineShape4. BorderColor = Color. Black;
lineShape35. BorderColor = Color. Black;
lineShape36. BorderColor = Color. Black;
lineShape37. BorderColor = Color. Black;
lineShape2. BorderWidth = 2;
lineShape10. BorderWidth = 2;
lineShape4. BorderWidth = 2;
lineShape6. BorderWidth = 2;
lineShape7. BorderWidth = 2;
lineShape8. BorderWidth = 2;
lineShape9. BorderWidth = 2;
lineShape11. BorderWidth = 2;
lineShape12. BorderWidth = 2;
lineShape13. BorderWidth = 2;
lineShape14. BorderWidth = 2;
lineShape15. BorderWidth = 2;
lineShape16. BorderWidth = 2;
lineShape17. BorderWidth = 2;
lineShape18. BorderWidth = 2;
lineShape19. BorderWidth = 2;
lineShape20. BorderWidth = 2;
lineShape21. BorderWidth = 2;
lineShape22. BorderWidth = 2;
lineShape23. BorderWidth = 2;
lineShape24. BorderWidth = 2;
lineShape25. BorderWidth = 2;
lineShape26. BorderWidth = 2;
lineShape27. BorderWidth = 2;
lineShape28. BorderWidth = 2;
lineShape29. BorderWidth = 2;
lineShape30. BorderWidth = 2;
lineShape31. BorderWidth = 2;
lineShape32. BorderWidth = 2;
lineShape33. BorderWidth = 2;
lineShape34. BorderWidth = 2;
lineShape35. BorderWidth = 2;
lineShape36. BorderWidth = 2;
lineShape37. BorderWidth = 2;
lineShape38. BorderWidth = 2;
lineShape39. BorderWidth = 2;
lineShape40. BorderWidth = 2;
lineShape41. BorderWidth = 2;
lineShape42. BorderWidth = 2;
lineShape43. BorderWidth = 2;
lineShape44. BorderWidth = 2;
lineShape45. BorderWidth = 2;
lineShape46. BorderWidth = 2;
lineShape47. BorderWidth = 2;
lineShape48. BorderWidth = 2;
lineShape49. BorderWidth = 2;
lineShape50. BorderWidth = 2;
lineShape51. BorderWidth = 2;
lineShape52. BorderWidth = 2;
lineShape53. BorderWidth = 2;
button3. Enabled = false;
button5. Enabled = false;
groupBox4. Visible = false;
label20. Text = «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
label21. Text = «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
label22. Text = «ΠΠΠ ΠΠΠΠΠΠΠΠΠ»;
if (label14. Text == «1») lineShape19. BorderColor = Color. LimeGreen; else lineShape19. BorderColor = Color. Red;
if (label15. Text == «1») lineShape20. BorderColor = Color. LimeGreen; else lineShape20. BorderColor = Color. Red;
if (label16. Text == «1») lineShape24. BorderColor = Color. LimeGreen; else lineShape24. BorderColor = Color. Red;
if (label17. Text == «1») lineShape23. BorderColor = Color. LimeGreen; else lineShape23. BorderColor = Color. Red;
if (label18. Text == «1») lineShape28. BorderColor = Color. LimeGreen; else lineShape28. BorderColor = Color. Red;
if (label19. Text == «1») lineShape27. BorderColor = Color. LimeGreen; else lineShape27. BorderColor = Color. Red;
lineShape41. BorderColor = Color. IndianRed; lineShape42. BorderColor = Color. IndianRed; lineShape43. BorderColor = Color. IndianRed; lineShape44. BorderColor = Color. IndianRed;
lineShape45. BorderColor = Color. IndianRed; lineShape48. BorderColor = Color. IndianRed; lineShape47. BorderColor = Color. IndianRed; lineShape46. BorderColor = Color. IndianRed;
button1. Enabled = true;
button2. Enabled = true;
groupBox2. Visible = false;
groupBox3. Visible = false;
label27. Visible = false;
}
}
}