请教各位一个初中题目,看泡CSDN的高手们的代数水平如何? 求一个数字,此数字有如下特点:1.最后两位是342.此数是34的整数倍。3.此数各位之和为34。求满足此三条件最小整数是?~_~看哪位高人还记得这些东西?不要骂我无聊哦!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 long n = 34; const int key = 34; CString str, strLast2, str1; long nAdd, nLen; while(1) { str.Format("%d", n); strLast2 = str.Right(2); nLen = str.GetLength(); nAdd = 0; for(int i=0; i<nLen; i++) { str1.Format("%c", str.GetAt(i)); nAdd += atoi(str1); } if( n%key != 0 || strLast2 != "34" || nAdd != key) { n++; continue; } else break; } str.Format("%d", n); AfxMessageBox(str); 就算代数忘了,for循环还是不会忘的 双缓冲绘图能在对话框中使用吗? 怎样学习MFC? 关于vc编译的问题 EnableMenu的疑惑 求教:基于CEditView类的视图中能存放多少数据? 不想再用VC了,想换份少和VC打交道的工作,请大家给我点意见,该找哪方面的工作好? 小小问题。VC++安装的一点点问题。 分不多了!请教 让静态文本框 自适应窗口的变化,始终居中?? 怪了,成员变量不能用?? CoMarshalInterThreadInterfaceInStream 内部是否会增加接口的引用计数? 求助, 直接打开一个open对话框的问题 如何结束一个程序,执行一个新的程序?
const int key = 34; CString str, strLast2, str1;
long nAdd, nLen;
while(1)
{
str.Format("%d", n);
strLast2 = str.Right(2); nLen = str.GetLength();
nAdd = 0;
for(int i=0; i<nLen; i++)
{
str1.Format("%c", str.GetAt(i));
nAdd += atoi(str1);
}
if( n%key != 0 || strLast2 != "34" || nAdd != key)
{
n++;
continue;
}
else
break; }
str.Format("%d", n);
AfxMessageBox(str);