问题 填空题

请补充main函数,该函数的功能是:计算三名学生学科的平均成绩。 例如,当score[N][M]={{83.5,82,86,65,67},{80,91.5,84, 99,95},{90,95,86,95,97}时,五门学科的平均分为:84.5 89.5 85.3 86.3 86.3。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: # include<stdio, h> #define N 3 #define M 5 main ( ) { int i,j; static float score [N] [M]= { {83.5, 82,86, 65,67}, {80,91.5,84,99,95}, {90, 95, 86, 95, 97} }; static float bb[N]; clrscr (); for ( i=0; i<M; i++) bb[i]=0.0; for(i=0;i< 【1】 ;i++) { for(j=0;j< 【2】 ;j++) bb [j]+=score [i] [j]; } for (i=0; i<M; i++) print f (" \nsubject%d\taverage=%5.1 f", i+1, 【3】 ); return 0; }

答案

参考答案:[1]N [2]M (3)bb[i]/N

解析: 填空1:由循环体中的score[i][j]可以推断出,变量i的取值范围是从0到N-1。填空2:由循环体中的score[i][j]也可以推断出,变量j的取值范围是从0到M-1。填空3:各科的平均分等于各科的总分除以学生人数,此时数组bb中保存的是各科的总分,所以要除以N得到各科的平均分。

单项选择题

Social control refers to social processes, planned or unplanned, by which people are taught, persuaded, or forced to conform to norms. In every society, some punishments or negative sanctions are established for deviant behavior. Without deviant behavior there would not be need for social control and without social control there would not be a way of recognizing the boundary between the acceptable and the unacceptable.

Social control may be either formal or informal. Informal mechanisms include expressions of disapproval by significant others and withholding of positive rewards for disapproved behavior. Most people internalize norms in the course of socialization. This is any group’s most powerful protection against deviance, in that the individual’s own conscience operates as an agent of social control. When informal sanctions fail, formal agents of social control may be called upon. In contemporary society, such formal agents and agencies include psychiatry and other mental health professions; mental hospitals; police and courts of law; prisons; and social welfare agencies. All these formal agents function to limit, correct, and control violation of norms. Conflict theorists would also point out that social control agents and systems tend, in any society, to serve the interests of powerful groups and to enforce the norms most beneficial to those who make the rules and who, therefore, define unacceptable behavior.

Social control, whether formal or informal, has a dual function. First, it punishes the wrongdoer and reaff’irms the boundaries of acceptable behavior. Second, and less recognized, it regulates the manner in which deviants are treated.

Formal agents of social control include the following EXCEPT ().

A. police stations

B. mental hospitals

C. welfare agencies

D. vocational schools

单项选择题