Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<sstream>
  4. using namespace std;
  5. int main(){
  6. string a;
  7. getline(cin, a);
  8. string w[100];
  9. int c = 0;
  10. stringstream X;
  11. X << a;
  12. while (X >> w[c++]);
  13. c--;
  14. int min;
  15. min = w[0].size();
  16.  
  17. for (int i = 0; i < c; i++){
  18. if (min > w[i].size()){
  19.  
  20. min = w[i].size();
  21. }
  22.  
  23. }
  24. cout << min;
  25. system("pause");
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement