Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string str;
  10.  
  11. cout << "Besedilo(20): ";
  12. getline(cin, str);
  13.  
  14. int stev_str = str.length();
  15.  
  16. while (stev_str > 20)
  17. {
  18. cout << "Vpisete lahko 20 ali manj znakov!" << endl;
  19. getline(cin, str);
  20. stev_str = str.length();
  21. }
  22.  
  23. cout << "Besedilo ima " << stev_str << " znakov." << endl;
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement