#include "stdio.h"
main()
{
unsigned int x,y,z,n,a;
printf ("please input n number ;\n\n");
scanf ("%d",&n);
a=0;
for (x=0;x<=n;x++)
{for (y=0;2*y<=n;y++)
{
for (z=0;3*z<=n;z++)
if (x+2*y+3*z==n)
a++;}}
printf ("a=%d\n\n",a);
}
main()
{
unsigned int x,y,z,n,a;
printf ("please input n number ;\n\n");
scanf ("%d",&n);
a=0;
for (x=0;x<=n;x++)
{for (y=0;2*y<=n;y++)
{
for (z=0;3*z<=n;z++)
if (x+2*y+3*z==n)
a++;}}
printf ("a=%d\n\n",a);
}
[此贴子已经被作者于2006-2-13 12:49:19编辑过]
最好的域名、虚拟主机、VPS www.