М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
kazah5676446
kazah5676446
04.02.2020 00:24 •  Информатика

Створити програму-модель гри «Камінь – ножиці - папір»,

👇
Ответ:
zatheeva
zatheeva
04.02.2020

import random

options=["rock", "scissors", "paper"]

player_choice=input("Choose one: rock, scissors or paper: ")

computer_choice=random.choice(options)

print("You choosed: "+player_choice)

print("Computer choosed: "+computer_choice)

if player_choice=="scissors":

   if computer_choice=="rock":

       print("You lose!")

   elif computer_choice=="paper":

       print("Congratulations! You won!")

   elif computer_choice=="scissors":

       print("Draw! Try again.")

if player_choice=="rock":

   if computer_choice=="rock":

       print("Draw! Try again.")

   elif computer_choice=="paper":

       print("You lose")

   elif computer_choice=="scissors":

       print("Congratulations! You won!")

if player_choice=="paper":

   if computer_choice=="rock":

       print("Congratulations! You won!")

   elif computer_choice=="paper":

       print("Draw! Try again.")

   elif computer_choice=="scissors":

       print("You lose!")    

Объяснение:

Можеш перекласти текст з англійської та переробити на свій смак. Вчителі теж можуть знайти цей сайт :)

4,4(89 оценок)
Открыть все ответы
Ответ:
Z8Z
Z8Z
04.02.2020

#include <iostream>

using namespace std;

int main()
{
setlocale(LC_ALL, "Russian");
char key;
int i;
int a[255];
float arifm=0,sum=0,b=0;

cout << "Введите числа от а до б через пробел! (Условие: a < b)"<<endl;

for (i=0; i < 254; i++){
cin >> a[i];

if(i >= 1 && a[i] < a[i-1]){
break;
}
b++;
}

cout << "Получили числа: ";
for (i=0;i < b; i++){
cout << " " << a[i];
sum += a[i];
}
cout << endl<< "Сумма чисел = " << sum << endl;
arifm = sum / (b);
cout << "Среднее арифметическое = " << arifm << endl;
system ("pause");
}

 

Только не дописал выход из цыкла.. сейчас он при нарушение условия а < б
Если надо думаю справитесь с do while 

4,4(29 оценок)
Ответ:
Linamouse
Linamouse
04.02.2020

уточнять на каком языке программирования нужно написать задачки. Я же напишу на С++. Алгоритм везде будет один и тот же.

1 задача

int x1 = 0;

int x2 = 0;

int x3 = 0;

int x4 = 0;

int x5 = 0;

cin >> x1;

cin >> x2;

cin >> x3;

cin >> x4;

cin >> x5;

double sr = 0.0;

sr = (x1+x2+x3+x4+x5)/5;

Или же можно сделать по проще

int x = 0;

int sum = 0;

double sr = 0.0;

for(int i = 0; i<5; i++){

cin >> x;

sum = sum +x;

}

sr = sum/5;

2 Задача

int number = 5;

for(int i = 2; i<20; i=i+2){

number = number + i;

}

4,4(74 оценок)
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ