/*第一题*/
#include
#define N 10
int main(void){
int array[N],sum=0,n=0;/*sum=数列和 n=大兄悉于等于乱尘拦均值元素个数*/
float mean;/*数列均值*/
哗胡 int i;
for(i=0;iscanf("%d",array+i);
sum+=array[i];
}
mean=sum/10.0;
for(i=0;i(array[i]>=mean)?n++:n-0;
printf("均值为:%.2f\n大于等于均值的个数:%d\n",mean,n);
return 0;
}
/*第二题*/
#include
int main(void){
float x,y;
scanf("%f%f",&x,&y);
printf("x+y=%f\nx-y=%f\nx*y=%f\n",x+y,x-y,x*y);
if(y!=0)
printf("x/y=%f\n",x/y);
else
printf("error:divisor is 0.\n");
return 0;
}
#include <铅返stdio.h>
#include
int main()
{
int i,t=0;
int a[10];
float total=0,ave;
for(i=0;i<槐蚂饥10;i++)
{
scanf("%d",&a[i]);
total=total+a[i];
}
ave=total/10;
for(i=0;i<10;i++)
{
if(a[i]>=ave)
t++;
}
printf("average value:%0.2f\n",ave);
printf("物枣there are %d number",t);
return 0;
}
#include
int main()
{
int ave=0,arr[10],count=0,i=0;
for(i=0;i<10;++i)
{
scanf("%d",arr+i);
ave +=arr[i];
}
ave /=10;
for(i=0;i<哗绝旅10;++i)
if(arr[i]>=ave) ++count;
printf("AVE:%d\n",ave);
乱凳 printf("Larger than AVE count:%d\n",count);
宏扰 return ;
}
#include
int main()
{
double x,y;
scanf("%lf%lf",&x,&y);
printf("Add x and y:%lf\n",x+y);
printf("Minus x and y:%lf\n",x-y);
printf("Multi x and y:%lf\n",x*y);
printf("Divid x and y:%lf\n",y==0.0 ? 0 : x/y);
return 0;
}