Advertisement
Mlack

957. Квадратный корень

Dec 29th, 2012
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. //957. Квадратный корень
  2. //zadacha from e-olimp
  3.  
  4. #include<iostream>
  5. #include<cmath>
  6. #include<string>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11.  string str;
  12.  cin>>str;
  13.  float sum=0;
  14.  for (int i = 0; i < str.length();i++)
  15.     {
  16.         sum += str[i] - '0';
  17.     }
  18.     cout.setf(ios::fixed);
  19.     cout.precision(3);
  20.     cout<<sqrt(sum)<<endl;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement