#include
#include
#include
void main()
{
int temp;
float sum = 0;
srand((unsigned)time(NULL));
for(int i = 0; i < 30; i++)
{
temp = rand()%100 + 100;
sum += (float)temp;
printf("No.%d %d\n", i+1, temp);
}
printf("AVER = %f\n", sum /30);
}
#include
#include
#include
int main(void)
{
srand((unsigned int) time(0));
float avg=0;
for (int i = 0; i < 30; ++i)
avg+= rand() % 100 + 100;
printf("average=%f\n", avg/30);
return 0;
}
任务,路过,
还需回答六个推荐问题,如果不是有人已经答得很漂亮了,我也可以做这个题的