#include <stdio.h>
#include <math.h>
int main() {
int n,a;
printf("Nhap vao so nguyen duong: ");
scanf("%d", &n);
if(n>0)
{
a=sqrt(n);
if((a*a)==n)
printf("So ban da nhap vao la so chinh phuong");
else
printf("So ban da nhap vao ko phai la so chinh phuong");
var n: longint;
function cp(x: longint): boolean;
begin
cp:=false;
if x<0 then exit;
if x=sqr(trunc(sqrt(x))) then cp:=true;
end;
begin
write('Nhap N='); readln(n);
if cp(n) then write('Day la so chinh phuong') else write('Khong phai so chinh phuong');
readln
end.
Program hotrotinhoc;
var n: longint;
function cp(x: longint): boolean;
begin
cp:=false;
if x<0 then exit;
if x=sqr(trunc(sqrt(x))) then cp:=true;
end;
begin
write('Nhap N='); readln(n);
if cp(n) then write('Day la so chinh phuong') else write('Khong phai so chinh phuong');
readln
end.