第三週プロジェクト張三李四年齢問題
979 ワード
<span style="font-family:KaiTi_GB2312;color:#993399;"><strong>/*
*Copyright(c) 2016,
*All rights reserved.
* :main.cpp
* :
* :2016 3 12
* :v1.0
*
* : , , , , 26, 880,
20 。
* :
* :
*/ #include<iostream>
using namespace std;
int main()
{ <img src="http://img.blog.csdn.net/20160313084149448?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
int a,n,i;
for(a=1;a<=4;a++)
{
for(n=1;n<=6;n++)
{
if(4*n+6*a==26&&n*(n+a)*(n+a+a)*(n+a+a+a)==880)
{
for(i=n;i<=n+19*a;i+=a)
{
cout<<i<<" ";
}
cout<<" "<<n<<" "<<a<<endl;
}
}
}
return 0;
} </strong></span>