#include <iostream>
#include <string.h>
#include <time.h>
using namespace std;
char day_of_today[20];
char t()
{
time_t now_time;
struct tm *timeinfo;
time(&now_time);
timeinfo = localtime(&now_time);
strftime(day_of_today, 100, "%d-%m-%Y %X",timeinfo);
}
int main()
{
char question[5][50] = {"На улице солнечно?", "Ты живешь в Бресте?", "Ты учишься в Бресте?", "Ты учишься в университете?", "Ты сейчас на занятиях?"};
char answer[2][50] = {"Круто!", "Жаль..."};
char ans[3][5] = {"yes", "no"};
int i=0;
for(i=0; i<5; i++)
{
t();
cout << day_of_today <<" <comp>: " << question[i] << endl;
t();
cout << day_of_today << " <you>: ";
cin >> ans[2];
t();
if(!strcmp(ans[2], ans[0]))
{
switch(i)
{
case 0:
cout << day_of_today <<" <comp>: " << answer[0] << endl;
break;
case 1:
cout << day_of_today <<" <comp>: " << answer[0] << endl;
break;
case 2:
cout << day_of_today <<" <comp>: " << answer[0] << endl;
break;
default:
cout << day_of_today <<" <comp>: " << answer[1] << endl;
break;
}
}
else
{
if(!strcmp(ans[2], ans[1]))
{
switch(i)
{
case 3:
cout << day_of_today <<" <comp>: " << answer[0] << endl;
break;
case 4:
cout << day_of_today <<" <comp>: " << answer[0] << endl;
break;
default:
cout << day_of_today <<" <comp>: " << answer[1] << endl;
break;
}
}
else
{
i--;
}
}
}
t();
cout << day_of_today <<" <comp>: " << "Buy!" << endl;
return 0;
}