Advertisement
Andites

ОИБ 3 лаба

Nov 1st, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string W;
  10. int sq=0;
  11. cout << "Enter word: ";
  12. cin >> W;
  13. cout << "Length: "<< W.length()<<endl;
  14. int l = W.length();
  15. for(int i=0;i<l*l;i++){
  16. if(l<pow(i,2)){
  17. sq=i*i;
  18. break;
  19. }
  20. }
  21. cout << sq;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement