Program egor_sasha; var num_eg, num_sash,pri,pri1: real; var mes_eg,mes_sash: real; beginwriteln('numer egora'); readln(num_eg); writeln('numer sashi'); readln(num_sash); writeln('mesto egora (verkh=1,vniz=0)'); readln(mes_eg); writeln('mesto sashi (verkh=1,vniz=0)'); readln(mes_sash); pri: =num_sash+1; pri1: =num_eg+1; if num_eg=pri then writeln('yes') else writeln('no'); if num_sash=pri1 then writeln('yes') else writeln('no'); if mes_eg=1 then writeln('egor-high')else writeln('egor-low'); if mes_sash=1 then writeln('sasha-high')else writeln('sasha-low'); end.
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
using namespace std;
//Compiler version g++ 6.3.0
using namespace std;
void StartGame()
{
cout << " Игра угадай число";
cout << " У меня есть число между 1 и 1000 Отгадайте и введите ваше число "
<< endl;
cout << " Угадайте и ведите число" ;
}
int RandElement(int *a)
{
*a = rand()%10+1;
return *a;
}
int InputElement(int *b)
{
cin >> *b;
return *b;
}
void WinLose(int &a , int &b)
{
for(int i=0;i<1;i++)
{
if( b==a)
{
cout << "Вы угадали число" << endl;
break;
}
if( b<a)
{
cout << "Вы не угадали.Даное число больше" << endl;
}
if( b>a)
{
cout << "Вы не угадали.Даное число меньше" << endl;
}
if(b!=a&&i==5)//Проверка
{
cout<<"К сожалению Вы так и не смогли угадать число...\n";
}
}
cout << " Бот загадал число " << a;
}
int main()
{
srand(time(0));
int a,b;
//setlocale(LC_CTYPE, "rus");
StartGame();
RandElement(&a);
InputElement(&b);
WinLose(a,b);
}