Last active
August 29, 2015 13:56
-
-
Save BitPuffin/8926049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() { | |
std::string sentencetheytyped; // string variable aka placeholder aka memory banks for the sentence they are asked to type | |
cout << "type a sentence" << endl; //asks them to type the sentence to be translated, it asks inside the terminal. the endl just is like hitting enter in a word proccessor, so endl just makes it look nice. every output after it will now be on a new line | |
std::getline(cin, sentencetheytyped); //waits for a sentence and when they hit enter puts it into the "sentencetheytyped" string variable | |
for (int index = 0; index<sentencetheytyped.size(); index++) { //prints a charachter then does a newline | |
cout << sentencetheytyped[index] << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment