SHARE
TWEET

Bài 6

chinh97nd Aug 20th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n, can;
  7.  
  8.     do
  9.     {
  10.         cout << "n = ";
  11.         cin >> n;
  12.     } while (n < 0);
  13.  
  14.     can = sqrt(n);
  15.  
  16.     if (can*can == n)
  17.         cout << n << " la so chinh phuong\n";
  18.     else
  19.         cout << "Khong phai so chinh phuong" << endl;
  20.    
  21.     return 0;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top