C语言编写程序

来源:百度知道 编辑:UC知道 时间:2024/05/09 14:35:16
1.编程:求出10至100之内能同时被2、3、11整除的数,并输出,同时计算出这些数的合计值。
2.随意输入8个整数,并且记录到一个一维数组中,按每行4个数共分两行输出这些整数。

共两道题目,用turboc2编写,请务必正确,快啊,现在要用,谢谢!
我们刚刚学嘛,不要想的太复杂,字要详细并且正确就行

#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
main()
{
int a=0,s,;
for (s=10;s<101;s++)
{if (s%2==0 && s%33==0) printf("%d",s);a=a+s;}
printf("he zhi shi: %d",a);
getch();
return 0;
}

////////////////////////////////////////////////////////////////

#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
main()
{
int a,s,b[8];
for (s=0;s<8;s++)
{scanf("%d",&a);
fflush(stdin);
b[s]=a; }

for (s=0;s<8;s++)
{ printf("%d",b[s]);
if (s==3) printf("\n"); }
getch();
return 0;
}

没看清,原来不是用C++啊

1.
main()
{
int n,sum=0;
for(n=10;n<=100;n++)
{
if(n%2==0&&n%3==0&&n%11==0)
{
p