# include <iostream.h> # include <math.h> void main(){ int n,i, a[100],vt,dem=0; cout<<"Nhap vao so phan tu cua mang : "; cin>>n; for(i=0;i<n;i++){ cout<<"Gia tri a["<<i<<"]="; cin>>a[i]; } cout<<"Cac so chinh phuong la : " ; int k; for(i=0;i<n;i++){ k=sqrt(a[i]); if(k*k==a[i]){ cout<<a[i]<<","; vt=i; dem++; } } cout<<" \ nCo "<<dem<<" so chinh phuong ! "<<endl; cout<<"Vi tri : "<<endl; for(i=0;i<n;i++){ k=sqrt(a[i]); if(k*k==a[i]){ vt=i; cout <<"a["<<vt<<"];"; }} }