Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Last active August 29, 2015 13:56
Show Gist options
  • Save BitPuffin/8926049 to your computer and use it in GitHub Desktop.
Save BitPuffin/8926049 to your computer and use it in GitHub Desktop.
#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