Advertisement
pexea12

Lam

Sep 10th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6.     long long t, l, r, i, a, x, idem = 0;
  7.     cin >> t;
  8.     for(i = 0; i < t; i++)
  9.     {
  10.         cin >> l >> r;
  11.    
  12.            for(x = l; x <= r; x++)
  13.            {
  14.                a = int(sqrt(x));
  15.                if(a * a == x)
  16.                   idem++;
  17.            }
  18.            cout << idem << "\n";
  19.            idem = 0;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement