Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //957. Квадратный корень
- //zadacha from e-olimp
- #include<iostream>
- #include<cmath>
- #include<string>
- using namespace std;
- int main() {
- string str;
- cin>>str;
- float sum=0;
- for (int i = 0; i < str.length();i++)
- {
- sum += str[i] - '0';
- }
- cout.setf(ios::fixed);
- cout.precision(3);
- cout<<sqrt(sum)<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement