wenboooo @ 2021-01-30 12:46:44
#include <stdio.h>
int a[600],*o=a,*p=a,*q=a;
int dan(int x)
{
int y=2,b=0;
while(x%y!=0)
{
y++;
if(y=x-1)
{
b=1;
break;
}
}return b>0?x:0;
}
int main()
{
int x,y=2,n,sum;
scanf("%d",&n);
for(x=0;x<=n/3;x++)
{
a[x]=dan(y);
while(a[x]==0)
{
y++;
a[x]=dan(y);
}
}while(n!=*o+*p+*q)
{
if(*q==a[n/3])
if(*p==a[n/3])
q++;
else
p++;
else q++;
}
printf("%d %d %d",*o,*p,*q);
return 0;
}
by _caiji_ @ 2021-01-30 14:34:25
C语言不能用中括号访问数组吗,用指针干吗,我看吐了
找到一处明显的错误
if(y=x-1)
改成
if(y==x-1)