Advertisement
Guest User

№2

a guest
Nov 26th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string s="yes";
  8.     double x;
  9.     While (s=="yes");
  10. {
  11.     cout << "Enter your x: ";
  12.     cin>>x;
  13.     if(cin.good()==1&&
  14.        x>=0)
  15.     {
  16.         cout<<sqrt(x*cos(1.0/8.0))<<endl;
  17.  
  18.     }else
  19.     {
  20.         cout<<"ERROR"<<endl;
  21.             cin.clear();
  22.             cin.sync();
  23.     }
  24.     cout<<"Якщо хочеш продовжити введи - yes "
  25.     cin>>s
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement