#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
void change_color(int color)
{ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color); }
int main()
{ char ch, str1[100] = "AI, please answer this question", str2[100], str3[100], question[100];
int ctr1=0, ctr2=0, stop;
change_color(3);
do { ch = getch();
str3[ctr1++] = ch;
cout << str1[ctr1-1];
if(ch == ',')
ctr2 = -1;
str2[ctr2++] = ch;
if(ch == '.')
stop = ctr2 - 1;
} while(ch != 13 && ch != 27);
if(ch == 27)
return 0;
str2[stop] = 0;
str3[ctr1] = '\0';
change_color(2); //128);
cout << "\n\nOK, ask! \n\n";
change_color(3);
gets(question);
if(ch == 13)
{ change_color(2); //128);
cout << "\n" << str2;
getch();
}
}
#include <stdio.h>
#include <conio.h>
#include <windows.h>
void change_color(int color)
{ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color); }
int main()
{ char ch, str1[100] = "AI, please answer this question", str2[100], str3[100], question[100];
int ctr1=0, ctr2=0, stop;
change_color(3);
do { ch = getch();
str3[ctr1++] = ch;
cout << str1[ctr1-1];
if(ch == ',')
ctr2 = -1;
str2[ctr2++] = ch;
if(ch == '.')
stop = ctr2 - 1;
} while(ch != 13 && ch != 27);
if(ch == 27)
return 0;
str2[stop] = 0;
str3[ctr1] = '\0';
change_color(2); //128);
cout << "\n\nOK, ask! \n\n";
change_color(3);
gets(question);
if(ch == 13)
{ change_color(2); //128);
cout << "\n" << str2;
getch();
}
}
No comments:
Post a Comment