请帮我看一下,谢谢了 我不知道哪错了,怎么不输出?
我用的VC6.0,汉化版.请帮我看一下哪里出问题了,我是刚开始学的. 编译没问题,只是运行后没结果.
int nResultCount=0;
int nFirstDigit;
int nSecondDigit;
int nThirdDigit;
CString strOutput;
for(int nCount=100;nCount<=999;nCount++)
{nFirstDigit=nCount-nCount/10*10;
nSecondDigit=nCount-nCount/100*100;
nThirdDigit=nCount/100;
if (nFirstDigit*nFirstDigit*nFirstDigit+
nSecondDigit*nSecondDigit*nSecondDigit+
nThirdDigit*nThirdDigit*nThirdDigit==nCount)
{
strOutput.Format("第%d个水仙花数是:%d",nResultCount+1,nCount);
pDC->TextOut(0,nResultCount*16,strOutput);
nResultCount++;
}
}