daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.    string s;
  10.    cout << "Podaj imie i nazwisko: ";
  11.    getline(cin,s);   // pobiera linię tekstu ze strumienia
  12.  
  13.    string s1=s.substr(0,s.find(" "));  // początek, liczba znaków
  14.    string s2=s.substr(s.find(" ")+1);  // jeżeli nie podamy liczby znaków odczyta do końca łańcucha
  15.  
  16.    cout << s1 << endl;
  17.    cout <<s2 << endl;
  18.    system("pause");
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top