Created
May 5, 2015 21:38
-
-
Save rogerioagjr/41526c406ffaebc7e3d6 to your computer and use it in GitHub Desktop.
String de C++
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 <string> | |
#include <iostream> // cin e cout | |
using namespace std; | |
int main(){ | |
string frase; // declaro a string frase | |
cin >> frase; // leio o valor de frase | |
// imprimo o tamanho de frase e substring nela contida, a partir da posição 2 | |
cout << frase.size() << " " << frase.substr(2) << "\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment