This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Данный код выведет 0. Почему: | |
вычисление значения выражения (31 - 5*a): | |
a = 10, поэтому 5*a = 50, a 31 - 50 = -19 | |
вычисление значения выражения (-19/38): | |
банальное деление. ответ: -0,5. в данном случае деление является целочисленным, поэтому ответом является число 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApp2 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int age = 18; | |
int countOfPets = 1; | |
double height = 1.73; | |
float weight = 61.5f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main() | |
{ | |
int start = 5; | |
int step = 7; | |
int max = 103; | |
int currentValue = start; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main() | |
{ | |
int minNumber = 1; | |
int maxNumber = 101; | |
int divisorThree = 3; | |
int divisorFive = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string showMessage1 = "1"; | |
string showMessage2 = "2"; | |
string showRandomNumber = "3"; | |
string clearConsole = "4"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class CurrencyConverter | |
{ | |
static void ShowBalance(double usd, double eur, double gbp) | |
{ | |
Console.WriteLine("\nВаш баланс:"); | |
Console.WriteLine($"Доллары (USD): {usd:F2}"); | |
Console.WriteLine($"Евро (EUR): {eur:F2}"); | |
Console.WriteLine($"Фунты (GBP): {gbp:F2}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Write("Введите символ для рамки (например, *, #, %): "); | |
char frameSymbol = Console.ReadLine()[0]; | |
Console.Write("Введите имя: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string correctPassword = "budapesht"; | |
int maxAttempts = 3; | |
int attempts = 0; | |
bool isAuthenticated = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApp2 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Random random = new Random(); | |
int minN = 10; | |
int maxN = 25; | |
int minRange = 50; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Random random = new Random(); | |
int minRandom = 1; | |
int maxRandom = 100; | |
int baseNumber = 2; |
OlderNewer