In the 1960s, many young Americans were dissatisfied with American society. They wanted to end the Vietnam War and to make all of the people in the U.S. equal. Some of them decided to "dropout" of American society and form their own societies. They formed Utopia(乌托邦) communities, which they called "communes", where they could follow their philosophy of "do your own thing". A group of artists founded a commune in southern Colorado called "Drop City". Following the ideas, of philosopher and architect Buckminster Fuller, they built houses from pieces of old cars. Other groups, such as author Ken Kesey’s Merry’ Pranksters, the followers of San Francisco poet Steve Gaskin, and a group that called itself the Hog Farm, lived in old school houses and traveled around the United States. The Hog Farm became famous when they helped organize the Woodstock Rock Festival in 1969. Steve Gaskin’s followers tried to settle down on a farm in Tennessee, but they had to leave when some members of the group were attested for growing marijuana(大麻). However, not all communes believed in the philosophy of "do your own thing". Twin Oaks, a commune founded in Virginia in the late 1960s, was based on the ideas of psychologist B. F. Skinner. The people who lived at Twin Oaks were carefully controlled by Skinner’s "conditioning" techniques to do things that were good for the community. In 1972, Italian architect Paolo Soleri began to build Arcosanti, a Utopian city in Arizona, where 2,500 people will live closely together in one large building called an "archeology". Soleri believes that people must live closely together so that they will all become one.
A. In Southern Colorado, a group of artists founded a commune called ______.
B. A) Utopia C) Twin Oaks
C. B) Hog Farm D) Drop City
已知数据文件IN.dat中存有300个四位数,并已调用读函数Rdata()把这些数存入数组a中,请编写函数diffVal(),其功能是:求出个位数上的数减千位数上的数减百位数上的数减十位数上的数大于0的个数count,再求出所有满足此条件的四位数的平均值Ave1,以及不满足此条件的四位数平均值Ave2。最后调用写函数Wdata(),把结果输出到OUT.dat文件中。 例如,1239,9-1-2-3>0,则该数满足条件,计算平均值Ave1,且个数count=count+1。 8129,9-8-1-2<0,则该数不满足条件,计算平均值Ave2。 注意:部分源程序已经给出。程序中已定义数组a[300],已定义变量count、Ave1、Ave2。请勿改动主函数main()、读函数Rdata()和写函数Wdata()的内容。#include <stdio.h>#int a[300], count = 0;double Ave1 = 0.0, Ave2 = 0.0;void diffVal()void Rdata() FILE *fp; int i; fp = fopen("IN. dat", "r"); for (i=0; i<300; i++) fscanf(fp, "%d,", &a[i]); fclose(fp);void Wdata() FILE *fp; fp = fopen ("OUT. dat", "w"); fprintf(fp, "%d\n%7.2f\n%7.2f\n", count, Ave1, Ave2); fclose(fp);main() Rdata(); diffVal(); Wdata(); printf ("count=%d\n 满足条件的平均值 pzj 1=%7.2f\n 不满足条件的平均值pzj2=%7.2f\n", count, Ave1, Ave2);