Đây là code em làm
//kiem tra so amtrong//
#include<conio.h>
#include<stdio.h>
#include<math.h>
int main()
{
int n,tg,k,dem;
printf("nhap so n");
scanf("%d",&n);
tg=n;
int x=tg;
dem=1;
while(tg>10)
{
tg=tg/10;
dem++;
}
printf("dem=%d",dem);
int tong=0;
while(x>0)
{
k=x%10;
tong=tong+pow(k,dem);
x=x/10;
}
printf("\ntong cua cac so luy thua la %d",tong);
if(n==tong)
{
printf("\nla so amtrong");
}
else
{
printf("\nkhong la so amtrong");
}
}