This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
// Hàm kiểm tra xem một số có phải là số chính phương hay không | |
int is_chinh_phuong(int num) { | |
int sqrt_num = sqrt(num); | |
return (sqrt_num * sqrt_num == num); | |
} | |
// Hàm đếm số lượng số chính phương nhỏ hơn n và in ra các số đó |