跪求!哪位C语言高手帮忙编下下面的程序, 麻烦把程序发到[email protected]这个邮箱里。谢谢

作者&投稿:宫阁 (联系方式在网页底部的电邮联系)
哪位高手帮帮忙写下程序啊,用C语言但要原创啊(我只有80财富值了)发到我邮箱啊[email protected] 谢谢了~

其实我以前学过= =而且这个不是很难应该会。
可是我懒得打了。。。

给个简单的框架参考吧 加油 祝早点完成


#include
#include
#include
#define N 10
struct majors
{
int num;
char majorsname[12];
char teachername[15];
char clas[20];
int a,b,c;
double pjf;
};

void main()
{
void shuru(struct majors stu[N]);
void chuli(struct majors stu[N]);
void xiugai(struct majors stu[N]);
void shuchu(struct majors stu[N]);
void paixu(struct majors stu[N]);
void chaxun(struct majors stu[N]);
void tongj(struct majors stu[N]);
double pjf(struct majors stu[N]);
void bjgkm(struct majors stu[N]);
struct majors stu[N];
int i=0,j=0,p=0,u=0;
char str[70][500];
FILE *fp1,*fp;
if((fp=fopen("课程信息.txt","r"))==NULL)
printf("注意:为免出错,第一次使用本程序,请选1 手动输入课程信息.
");
else
{
for(i=1;i<=N;i++)
{
if(i==1)
fp=fopen("课程信息.txt","r");
fscanf(fp,"%d%s%s%s%d%d%d",&stu[i].num,stu[i].name,stu[i].teachername,stu[i].clas,&stu[i].a,&stu[i].b,&stu[i].c);
if(1==N)
fclose(fp);
}
}
int choice;
do{
for(i=0;i<18;i++)
printf("**");
printf("主菜单");
for(j=0;j<18;j++)
printf("**");
printf("
");
printf("#请选择:1 课程信息输入 2课程信息修改与删除 3 课程信息查询 4 信息输出 5 退出#
");
for(i=0;i<20;i++)
printf("***");
printf("**
");
scanf("%d",&choice);
switch(choice)
{
case 1 :
shuru(stu) ; break;
case 2 :
xiugai(stu) ; break;
case 3 :
chuli(stu) ; break;
case 4 :
shuchu(stu) ; break;
case 5 : break;
default : puts("error"); return;
}

} while(choice!=5);
fp1=fopen("课程信息.txt","w");
for(i=1;i<=N;i++)
{

fprintf(fp1,"%d ",stu[i].num);
fprintf(fp1,"%s ",stu[i].name);
fprintf(fp1,"%s ",stu[i].teachername);
fprintf(fp1,"%s ",stu[i].clas);
fprintf(fp1,"%d ",stu[i].a);
fprintf(fp1,"%d ",stu[i].b);
fprintf(fp1,"%d ",stu[i].c);
fprintf(fp1,"
");
}
puts("信息已保存在“课程信息.txt”中 Thank you!!");
fclose(fp1);
}

void shuru(struct majors stu[N])
{
}
void chuli(struct majors stu[N])
{
}
void xiugai(struct majors stu[N])
{
}
void shuchu(struct majors stu[N])
{
}
void paixu(struct majors stu[N])
{
}
void chaxun(struct majors stu[N])
{
}
void tongj(struct majors stu[N])
{
}
//double pjf(struct majors stu[N])
//{

//}
void bjgkm(struct majors stu[N])
{
}

/*
* main.c
*
* Created on: 2011-6-6
* Author: icelights
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define TotalStu 5 /*学生总数Total student*/

struct Database
{

/*学号Student No.*/
char sn[80];

/*笔试成绩Written test score*/
double wts;

/*理论课综合训练成绩扣分
*Comprehensive training course grades possessed*/
double ctcgp;

/*机考成绩Machine examination results*/
double mer;

/*上机扣分Computer possessed*/
double cp;

/*总成绩Total score*/
double ts;

/*挂科与否Hanged division */
int hd;

};

/*输出文件*/
void output(struct Database Stu[])
{
FILE *fp;

int liv_cnt;
if((fp=fopen("d:\\StuDBA.txt","wt+"))== NULL)
{
puts("Couldn't read the file\n");

}

rewind(fp);

for(liv_cnt = 0; liv_cnt < TotalStu; liv_cnt++)
{
fprintf(fp,"%s %lf %d\n" , Stu[liv_cnt].sn,
Stu[liv_cnt].ts, Stu[liv_cnt].hd);
}

if(fclose(fp))
{
puts("Fail to close the file.\n");

}

}

/*计算成绩&判断挂科*/
void cal(struct Database Stu[])
{

int liv_cnt;
for (liv_cnt = 0; liv_cnt < TotalStu; liv_cnt++)
{
Stu[liv_cnt].ts = (Stu[liv_cnt].wts - Stu[liv_cnt].ctcgp) * 0.6
+ (Stu[liv_cnt].mer - Stu[liv_cnt].cp) * 0.4;
printf("%s%lf%lf%lf%lf",
Stu[liv_cnt].sn, Stu[liv_cnt].wts, Stu[liv_cnt].ctcgp,
Stu[liv_cnt].mer, Stu[liv_cnt].cp);
if (Stu[liv_cnt].ts < 60)
{
Stu[liv_cnt].hd = 0;
}
else
{
Stu[liv_cnt].hd = 1;
}

}

output(Stu);
}
/*接受用户输入*/
void input(void)
{
struct Database Stu[TotalStu];
int liv_cnt;
puts("Please enter the Student No. Written test score");
puts("Comprehensive training course grades possessed");
puts("Machine examination results and Computer possessed");

for (liv_cnt = 0; liv_cnt < TotalStu; liv_cnt++)
{
scanf("%s%lf%lf%lf%lf",
Stu[liv_cnt].sn, &Stu[liv_cnt].wts, &Stu[liv_cnt].ctcgp,
&Stu[liv_cnt].mer, &Stu[liv_cnt].cp);

}/*end of for (liv_cnt = 0; liv_cnt < TotalStu; liv_cnt++)*/

cal(Stu);
}
/*主函数*/
int main(void)
{
input();
return 0;
}

理论课综合训练成绩扣分0~20,怎么没有输入?
#include<stdio.h>
void main()
{
int i;
int sum[i];

typedef struct stu
{
int NO;
int pen;
int integrate;
int robot;
int surf;
}S;

S stu[5];

for(int i=0;i<5;i++)
{
printf("输入学号,笔试成绩,理论课综合训练成绩扣分,机考成绩,上机扣分\n");
scanf("%d %d %d %d %d",&stu[i].NO,&stu[i].pen,&stu[i].integrate,&stu[i].robot,&stu[i].surf);

sum[i]=(stu[i].pen-stu[i].integrate)*(6/10)+(stu[i].robot-stu[i].surf)*(4/10);
if(sum[i]<60)
{
printf("该学员挂科\n");
}
}

for(int i=0;i<5;i++)
{
for(int j=0;j<5-i;j++)
{
if(sum[j]>sum[j+1])
{
int temp;
temp=sum[j];
sum[j]=sum[j+1];
sum[j+1]=temp;
}
}
}
for(int i=0;i<5;i++)
{
printf("%d ",sum[i]);

}
}

盘文件输入
并盘文件输出,
输入输出都没讲清楚。。。

相关视频

c语言高手帮帮忙!
用数组就可以实现了。定义变量循环累加,打印结果。include <stdio.h>#define N 10int main(){ char names[4][3]={"张","王","李","赵"}; int i,t,n=N,cnt[4]={0},f=0,z=0,max=0; printf("当前共%d个投票人 ,请投张:1 王:2 李:3 赵:4 (输入-1结束投票)\\n",N)

C语言高手们帮帮忙呀
main() \/*主题 { char c1,c2; \/*定义两个变量,C1和C2 for(c1='0',c2='9';c1<c2;c1++,c2--); \/*C1的初始值为0,C2的初始值为9如果C1<C2,则C1进行自增,C2进行自减 printf("%c%c",c1,c2); \/*输入C1C2的值 printf("\\n"); \/*输出回车(即换行)} 明显,首先C1C2从09...

C语言编程求助!!!求高手帮忙!感激不尽!
include "stdio.h"include"string.h"int main(){ int i,s = 0; \/*请修改此处:int和i间有空格; 计算的和值s首先要清零 *\/ char str[80];i=0;while ((str[i]=getchar())!='\\n')i++;str[i]='\\0';for(i=0;i<80;i++)if (str[i]>='0' && str[i]<='9') \/*...

一道c语言问题,请各位高手们帮帮忙,谢谢
char p[][20]={“get”,”put”,”out”};p是一个有3个元素的数组,数组中的每个元素都是一个char[20]类型的数组。也就是说,p是一个二维数组。strlen(p[0])+strlen(p[1])+ strlen(p[2])即计算p中的三个字符串的长度总和,为3+3+3=9。