displaying less than

This commit is contained in:
Jidong Xiao
2023-09-18 22:20:03 -04:00
parent 408cffb997
commit 79df990b25

View File

@@ -94,8 +94,8 @@ int main() {
int n,i;
std::cin >> n;
double *a = new double[n];
for (i=0; i<n; ++i) { a[i] = sqrt(i); }
for (i=0; i<n; ++i) {
for (i=0; i &lt; n; ++i) { a[i] = sqrt(i); }
for (i=0; i &lt; n; ++i) {
if ( double(int(a[i])) == a[i] )
std::cout << i << " is a perfect square " << std::endl;
}