帮画个流程图

来源:百度知道 编辑:UC知道 时间:2024/05/30 06:56:53
题目:
设李红.王建.赵明三名同学某年考了八门课程.要求分别统计出这三名同学学年总成绩.并按八门课程的总成绩高低排序.

#include <string.h>
#include <conio.h>
struct student /*定义结构体,存放学生信息(姓名,各科分数,总分)*/
{
char name[10];
float score[8];
float total;
};
void main()
{
struct student person[3]; /*定义结构体变量*/
struct student temp;

int i,j;
float t;
/*把三个人的名字存入结构体变量中*/
strcpy(person[0].name,"Lihong");
strcpy(person[1].name,"Wangjian");
strcpy(person[2].name,"Zhaoming");
/*外循环是分别输入三个同学的信息*/
for (i=0;i<3;i++)
{
printf("Please input scores of %s:",person[i].name);
/*先把总分负0*/
person[i].total=0;
/*内循环是对每个学生的8科成绩进行输入值,计算总成绩*/
for (j=0;j<8;j++)
{
scanf("%f",&t); /*输入成绩*/
person[i].total+=t; /*计算总成绩*/
person[i].score[j]=t; /*对各科付值*/
}
}
/*比较三个学生总成绩的高底*/

for (i=0;i<2;i+

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <string.h>
#include <dos.h>

/*---------------------------------------------------------------------
// 基本定义:地图和砖块
//---------------------------------------------------------------------*/
int map[26][10]; /* 游戏地图定义: 所有砖块将被描述在地图中 ............*/

typedef struct { int d[4][4]; } Block; /* 砖块结构定义 ...............*/
int BlockList[7][4][4] = { /* 七种传统的方块定义 .................*/
{ { 0, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 1, 0, 0 }, { 0, 1, 1, 0 } },
{ { 0, 0, 0, 0 }, { 0, 0, 2, 0 }, { 0, 0, 2, 0 }, { 0, 2, 2, 0 } },
{ { 0, 3, 0, 0 }, { 0, 3, 0, 0 }, { 0, 3, 0, 0 }, { 0, 3, 0, 0 } },
{ { 0, 4, 0, 0 }, { 0, 4, 4, 0 }, { 0, 0, 4, 0 }, { 0, 0, 0, 0 } },
{ { 0, 0, 5, 0 }, { 0, 5, 5, 0 }, { 0, 5, 0, 0 }, { 0, 0, 0, 0 } },
{ { 0, 6, 6, 6 }, { 0, 0, 6, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } },<