from os import system
from random import randint
answ = 'да'
answers = ['камень', 'ножницы', 'бумага']
while answ == 'да':
system("cls")
bot_balls = 0
person_balls = 0
while bot_balls < 3 and person_balls < 3:
person = str(input("\nВаш вариант: "))
bot = answers[randint(0, 2)]
print("Я выбрал:", bot)
if person == bot:
print("Ничья")
elif (person == answers[0] and bot == answers[1]) or (person == answers[1] and bot == answers[2]) or (person == answers[2] and bot == answers[1]):
print("Вы победили!")
person_balls += 1
elif (person == answers[0] and bot == answers[2]) or (person == answers[1] and bot == answers[0]) or (person == answers[2] and bot == answers[1]):
print("Вы проиграли!")
bot_balls += 1
print("Счет:", person_balls, ":", bot_balls)
answ = str(input("\nХотите продолжить?: "))
print(" за игру!")
if person_balls > bot_balls:
print("Вы победили со счетом:", person_balls, ":", bot_balls)
else:
print("Вы проигради со счетом:", person_balls, ":", bot_balls)
int[,] a = { { 1, 2, 17, 16, 6, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 }, { 1, 2, 17, 8, 16, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 } }; //естественно тут ваш двухмерный массив.
int i = 0;
int s = 0;
for (int j = 0; j < a.GetLength(1); j++)
{
var t = a[1, j];
if (t != 0 & t > 15) { i++; }
}
Console.WriteLine(i);
i = 0;
for (int j = 0; j < a.GetLength(0); j++)
var t = a[j, 4];
if (t%2!=0) { i++; s += t; }
if (i != 0) { Console.WriteLine(s / i); }
s = 0;
var t = a[3, j];
if (t % 4 == 0) { i++; s += t; Console.WriteLine(t); }
from os import system
from random import randint
answ = 'да'
answers = ['камень', 'ножницы', 'бумага']
while answ == 'да':
system("cls")
bot_balls = 0
person_balls = 0
while bot_balls < 3 and person_balls < 3:
person = str(input("\nВаш вариант: "))
bot = answers[randint(0, 2)]
print("Я выбрал:", bot)
if person == bot:
print("Ничья")
elif (person == answers[0] and bot == answers[1]) or (person == answers[1] and bot == answers[2]) or (person == answers[2] and bot == answers[1]):
print("Вы победили!")
person_balls += 1
elif (person == answers[0] and bot == answers[2]) or (person == answers[1] and bot == answers[0]) or (person == answers[2] and bot == answers[1]):
print("Вы проиграли!")
bot_balls += 1
print("Счет:", person_balls, ":", bot_balls)
answ = str(input("\nХотите продолжить?: "))
system("cls")
print(" за игру!")
if person_balls > bot_balls:
print("Вы победили со счетом:", person_balls, ":", bot_balls)
else:
print("Вы проигради со счетом:", person_balls, ":", bot_balls)
int[,] a = { { 1, 2, 17, 16, 6, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 }, { 1, 2, 17, 8, 16, 455, 867 }, { 1, 2, 17, 8, 5757, 455, 867 } }; //естественно тут ваш двухмерный массив.
int i = 0;
int s = 0;
for (int j = 0; j < a.GetLength(1); j++)
{
var t = a[1, j];
if (t != 0 & t > 15) { i++; }
}
Console.WriteLine(i);
i = 0;
for (int j = 0; j < a.GetLength(0); j++)
{
var t = a[j, 4];
if (t%2!=0) { i++; s += t; }
}
if (i != 0) { Console.WriteLine(s / i); }
i = 0;
s = 0;
for (int j = 0; j < a.GetLength(1); j++)
{
var t = a[3, j];
if (t % 4 == 0) { i++; s += t; Console.WriteLine(t); }
}
if (i != 0) { Console.WriteLine(s / i); }