Advertisement
Spocoman

07. Noise

Oct 28th, 2023
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cctype>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     string str, number;
  10.     getline(cin, str);
  11.  
  12.     for (int i = 0; str[i] != '.'; i++) {
  13.         if (isdigit(str[i])) {
  14.             number += str[i];
  15.         }
  16.     }
  17.  
  18.     cout << sqrt(stoi(number)) << endl;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement