不懂?
编写程序使一组数据测试能否被3,5,7整除,或只能被3整除,只能被7整除,只能被5整除,能被3,5或3,7或5,7整除,不能被3,5,7整除,要求采用 下列数据,记录并分类6,10,210,14,38,42,70,22,30C语言怎么编写?
#include<stdio.h>
main()
{ int i, a[8];
for(i=0;i<=8;i++)
scanf("%d",&a[i]);
for(i=0;i<=8;i++)
if(a[i]%3==0&&a[i]%35!=0) printf("只能被3整除",a[i]);
else if(a[i]%7==0&&a[i]%15!=0) printf("只能被7整除",a[i]);
else if(a[i]%5==0&&a[i]%21!=0) printf("只能被5整除",a[i]);
else if(a[i]%15==0&&a[i]%105!=0) printf("只能被3,5整除",a[i]);
else if(a[i]%21==0&&a[i]%105!=0) printf("只能被3,7整除",a[i]);
else if(a[i]%105==0) printf("只能被3,5,7整除",a[i]);
else printf("不能被3,5,7整除",a[i]);不对的