Jun 20, 2012 at 7:28pm UTC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#include <iostream>
using namespace std;
int main (){
string Answer;
cout << "Text" << endl;
cout << "Text" << endl;
cout << "text" << endl;
cout << "text" << endl;
cin >> Answer;
if (Answer == "B" ){
cout << "text" << endl;
cout << "text" << endl;
cout << "text" << endl;
}
else if (Answer == "BC" ){
cout << "text" << endl;
}
else if (Answer == "AB" ){
cout << "text" << endl;
}
else if (Answer == "A" ){
cout << "text" << endl;
}
else {
}
}
Basicly, i want the script to be able to let me type in another alternative. But after the "cin" command the script will just print the text and just stop running.
Last edited on Jun 20, 2012 at 7:40pm UTC
Jun 20, 2012 at 7:36pm UTC
Man i can help you but i didnt understand what you want to change.
Explain me again because i am not good in english,or add me in skype:magas1291
Jun 20, 2012 at 7:40pm UTC
Basicly, i want the script to be able to let me type in another alternative. But after the "cin" command the script will just print the text and just stop running.
Jun 20, 2012 at 7:42pm UTC
I mean, I want the script allow me to type in more than just 1 answer.
I'm not really "good" at explaining or english, but i attempt to do my best.
Last edited on Jun 20, 2012 at 7:43pm UTC
Jun 20, 2012 at 7:44pm UTC
You should use a loop if you want to run the code again.
Jun 20, 2012 at 7:45pm UTC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#include <iostream>
#include <cstdlib>
using namespace std;
int main (){
string Answer;
cout << "Text" << endl;
cout << "Text" << endl;
cout << "text" << endl;
cout << "text" << endl;
cin >> Answer;
if (Answer == "B" ){
cout << "text" << endl;
cout << "text" << endl;
cout << "text" << endl;
}
else if (Answer == "BC" ){
cout << "text" << endl;
}
else if (Answer == "AB" ){
cout << "text" << endl;
}
else if (Answer == "A" ){
cout << "text" << endl;
}
else
{
cout<<"You havent put a valid character" ;
}
system("pause" );
}
i made the <else> in the end.So i helped you?
Last edited on Jun 20, 2012 at 7:45pm UTC
Jun 20, 2012 at 7:46pm UTC
Zhuge, i admit your right.
Jun 20, 2012 at 7:46pm UTC
Man i cant understand you.
You want ,the program to ask you many times?
Jun 20, 2012 at 7:47pm UTC
thanks for helping me both of you, marking as solved
Jun 20, 2012 at 7:52pm UTC
Yeah, thanks mate :)
Last edited on Jun 20, 2012 at 7:52pm UTC
Jun 20, 2012 at 7:57pm UTC
No problem.If you want add me in skype to hlp you whenever you want.(i gave it to you up)