Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main()
- {
- string W;
- int sq=0;
- cout << "Enter word: ";
- cin >> W;
- cout << "Length: "<< W.length()<<endl;
- int l = W.length();
- for(int i=0;i<l*l;i++){
- if(l<pow(i,2)){
- sq=i*i;
- break;
- }
- }
- cout << sq;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement