- Joined
- Feb 16, 2009
- Messages
- 658
- Reaction score
- 96
Hey there,
I am new to coding. I started following tuts like yesterday so don't be too hard on me.
I made this little thingy and wanted to have the user input 3 random words, and then display them in all 6 possibility's.
But I can't find the good way to display them the way I want.
I just got problems with the output. An example will do, I don't need spoonfeeding. (advanced stuff will probably do too as long as it's included with a bit of explanation).
This is what I have so far:
I am new to coding. I started following tuts like yesterday so don't be too hard on me.
I made this little thingy and wanted to have the user input 3 random words, and then display them in all 6 possibility's.
But I can't find the good way to display them the way I want.
I just got problems with the output. An example will do, I don't need spoonfeeding. (advanced stuff will probably do too as long as it's included with a bit of explanation).
This is what I have so far:
PHP:
#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Hello there, i'd like you to type 3 random words" << endl;
string word1;// Random word 1
string word2;// Random word 2
string word3;// Random word 3
cin >> word1;//reads input
cin >> word2;//reads input
cin >> word3;//reads input
cout << "Ok. This magical piece of pro-ness software \nshows you your three words in ALL POSSIBLE ORDERS! \nIsn't that great? =D" << endl;
cout << word1, word2, word3 << endl;// All 6 possibilitys listed.
cout << word1, word3, word2 << endl;
cout << word2, word1, word3 << endl;
cout << word2, word3, word1 << endl;
cout << word3, word1, word2 << endl;
cout << word3, word2, word1 << endl;
system("Pause");// Pauses .bat file
return 0;
}