| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1051 人关注过本帖
标题:请各位哥哥姐姐帮忙看看这个程序??
只看楼主 加入收藏
jtaroy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-6-16
收藏
 问题点数:0 回复次数:3 
请各位哥哥姐姐帮忙看看这个程序??

这个程序在怎么不能运行啊!!请个位帮帮忙 过两天就要交老师了! 万分感谢!!!

学生信息管理系统:

#include<conio.h> #include<stdio.h> #include<dos.h> #include<graphics.h> #include<string.h> #include<process.h> #define N 5 long change(long n,long r) {long h; h=n%r; if(n/r!=0)change(n/r,r); printf("%ld",h); } struct birth { int year; int month; int day; }; struct student { int number; char name[20]; char sex; struct birth birth; int score; }students[N]; FILE *fp; int i; void Data_Load() { int j; long k; fp=fopen("student.txt","r+"); if(fp!=NULL) { for(i=0;i<N;i++) { if((j=fgetc(fp))==EOF) return; k=i-1; fseek(fp,k*sizeof(struct student),SEEK_SET); fread(&students[j],sizeof(struct student),1,fp); } } else { fp=fopen("student.txt","w"); i=1; } } void Data_Show(int j) { printf("\n\n\tN%3d\n",students[j].number); printf("\n\n\tName:%-20s\n\tSex:%2c\n",students[j].name,students[j].sex); printf("\n\tBirthday:(y/m/d):%4d%2d%2d",students[j].birth.year,students[j].birth.month,students[j].birth.day); printf("\n\n\tscore:%8d",students[j].score); } void Data_Input(int j) { fflush(stdin); printf("\n\n\t学号:"); scanf("%d",&students[j].number); printf("\n\n\t姓名:"); scanf("%s",students[j].name); printf("\n\t性别:(M / F:"); scanf("%2c",students[j].sex);

printf("\n\t出生日期:"); printf("\n\t年:"); scanf("%d",&students[j].birth.year); printf("\n\t月:"); scanf("%d",&students[j].birth.month); printf("\n\t日:"); scanf("%d",&students[j].birth.day); printf("\n\t分数:"); scanf("%d",&students[j].score); } void Data_Save() { int j; fp=fopen("a:\student.txt","w"); for(j=1;j<=i;j++) { fwrite(&students[j],sizeof(struct student),1,fp); } } void Datagraph() {long m,js,n,f,i,a[50],b[50],c[50],d[50],count=0,count1=0; char x[50],y[50];int driver=DETECT,mode,j; initgraph(&driver,&mode,"m:\\tc"); cleardevice(); for(j=1;j<200;j++) { setbkcolor(202-j); setcolor(j); circle(280,235,200-j); setfillstyle(1,j); setcolor(212-j); settextstyle(0,0,9); outtextxy(260-j,j-100,"Welcome"); outtextxy(480-j,380-j,"To"); outtextxy(j+3,460-j,"Enter!"); if(j==199) break; delay(1000); cleadevice(); setcolor(213-j); settextstyle(0,0,1); outtextxy(j+60,530-j," Any button to continue "); } getch(); closegraph(); } void Data_grapher() {long m,js,n,f,i,a[50],b[50],c[50],d[50],count=0,count1=0; char x[50],y[50];int driver=DETECT,mode,j; initgraph(&driver,&mode,"m:\\tc"); cleardevice(); for(j=1;j<200;j++) { setbkcolor(200-j); setcolor(j); circle(290,240,200-j); setfillstyle(1,j); setcolor(212-j); settextstyle(1,0,7); outtextxy(300-j,j-100,"Thank you!"); outtextxy(480-j,380-j,"GOOD LUCK!"); outtextxy(j+3,460-j,"Bye bye!"); if(j==19) break; delay(1000); cleardevice(); } getch(); } main() { int j,k; char ch; char *search_name; clrscr(); Data_graph(); Data_Load(); i--; do { printf("\n\n\n\t功能选择:"); printf("\n\tPress 1 ——读取信息:"); printf("\n\tPress 2 ——创建信息:"); printf("\n\tPress 3 ——删除信息:"); printf("\n\tPress 4 ——查询信息:"); printf("\n\tPress 5 ——插入信息:"); printf("\n\tPress 6 ——保存信息"); printf("\n\tPress 7 ——退出"); printf("\n\n"); printf("\t选择:"); ch=getchar(); switch(ch) { case 1: j=1; while(getch()!=0&&j<=i) DataShow(j++); if(j>i) printf("\n\tEnd of e_note\n"); break; case 2: while(getch()!=0&&i<N) { i++; Data_Input(i); if(i>2) printf("是否继续? Y/N"); ch=getch();if(ch==121) continue; if(ch==110) break;} if(i==N) printf("\ne file is filled\n"); break; case 3: if(i<1) { printf("\n没有记录!\n"); break;} printf("\nDelete N"); scanf("%d",&k); for(j=k;j<i;j++) { strcpy(students[j].name,students[j+1].name); students[j].sex=students[j+1].sex; students[j].birth.year=students[j+i].birth.year; students[j].birth.month=students[j+1].birth.month; students[j].birth.day=students[j+1].birth.day; students[j].score=students[j+1].score; } i--; break; case 4: printf("\n\t请输入姓名:"); gets(search_name); for(j=1;j<=i;j++) { if(strcmp(search_name,students[j].name)==0) { Data_Show(j); break; } if(j>i) printf("\n\t 对不起,没有该记录!"); break;} case 5: printf("\n\tInsert N"); scanf("%d",&k); for(j=i+1;j>k;j--) { strcpy(students[j].name,students[j-1].name); students[j].sex=students[j-1].sex; students[j].birth.year=students[j-1].birth.year; students[j].birth.month=students[j-1].birth.month; students[j].birth.day=students[j-1].birth.day; students[j].score=students[j-1].score; } Data_Input(k); i++; break; case 6: Data_Save(); exit(0); break; case 7: printf("\n\t是否保存?:(y/n)"); ch=getch(); if(ch=y) Data_Save(); fclose(fp); exit(0); default: printf("请选择:14\n"); } } while(1); Data_grapher();}

搜索更多相关主题的帖子: include 管理系统 change number 
2004-06-16 12:45
Knocker
Rank: 8Rank: 8
等 级:贵宾
威 望:47
帖 子:10454
专家分:603
注 册:2004-6-1
收藏
得分:0 
是因为:此程序已加密,非法拷贝者不得使用!

九洲方除百尺冰,映秀又遭蛮牛耕。汽笛嘶鸣国旗半,哀伤尽处是重生。     -老K
治国就是治吏。礼义廉耻,国之四维。四维不张,国之不国。   -毛泽东
2004-06-17 00:07
jtaroy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-6-16
收藏
得分:0 

那怎么解密啊

2004-06-17 20:49
chengstone
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
帖 子:562
专家分:226
注 册:2004-4-3
收藏
得分:0 

以下就是解开后的程序

#include<conio.h> #include<stdio.h> #include<dos.h> #include<graphics.h> #include<string.h> #include<process.h> #define N 5 long change(long n,long r) {long h; h=n%r; if(n/r!=0)change(n/r,r); printf("%ld",h); } struct birth { int year; int month; int day; }; struct student { int number; char name[20]; char sex; struct birth birth; int score; }students[N]; FILE *fp; int i; void Data_Load() { int j; long k; fp=fopen("student.txt","r+"); if(fp!=NULL) { for(i=0;i<N;i++) { if((j=fgetc(fp))==EOF) return; k=i-1; fseek(fp,k*sizeof(struct student),SEEK_SET); fread(&students[j],sizeof(struct student),1,fp); } } else { fp=fopen("student.txt","w"); i=1; } } void Data_Show(int j) { printf("\n\n\tN%3d\n",students[j].number); printf("\n\n\tName:%-20s\n\tSex:%2c\n",students[j].name,students[j].sex); printf("\n\tBirthday:(y/m/d):%4d%2d%2d",students[j].birth.year,students[j].birth.month,students[j].birth.day); printf("\n\n\tscore:%8d",students[j].score); } void Data_Input(int j) { fflush(stdin); printf("\n\n\t学号:"); scanf("%d",&students[j].number); printf("\n\n\t姓名:"); scanf("%s",students[j].name); printf("\n\t性别:(M / F):"); scanf("%2c",students[j].sex);

printf("\n\t出生日期:"); printf("\n\t年:"); scanf("%d",&students[j].birth.year); printf("\n\t月:"); scanf("%d",&students[j].birth.month); printf("\n\t日:"); scanf("%d",&students[j].birth.day); printf("\n\t分数:"); scanf("%d",&students[j].score); } void Data_Save() { int j; fp=fopen("a:\student.txt","w"); for(j=1;j<=i;j++) { fwrite(&students[j],sizeof(struct student),1,fp); } } void Data_graph() {long m,js,n,f,i,a[50],b[50],c[50],d[50],count=0,count1=0; char x[50],y[50];int driver=DETECT,mode,j; initgraph(&driver,&mode,"m:\\tc"); cleardevice();

for(j=1;j<200;j++) { setbkcolor(202-j); setcolor(j); circle(280,235,200-j); setfillstyle(1,j); setcolor(212-j); settextstyle(0,0,9); outtextxy(260-j,j-100,"Welcome"); outtextxy(480-j,380-j,"To"); outtextxy(j+3,460-j,"Enter!"); if(j==199) break; delay(1000); cleardevice(); setcolor(213-j); settextstyle(0,0,1); outtextxy(j+60,530-j," Any button to continue "); }

getch(); closegraph(); } void Data_grapher() {long m,js,n,f,i,a[50],b[50],c[50],d[50],count=0,count1=0; char x[50],y[50];int driver=DETECT,mode,j; initgraph(&driver,&mode,"m:\\tc");

cleardevice();

for(j=1;j<200;j++) { setbkcolor(200-j); setcolor(j); circle(290,240,200-j); setfillstyle(1,j); setcolor(212-j); settextstyle(1,0,7); outtextxy(300-j,j-100,"Thank you!"); outtextxy(480-j,380-j,"GOOD LUCK!"); outtextxy(j+3,460-j,"Bye bye!"); if(j==19) break; delay(1000); cleardevice();

} getch(); } main() { int j,k; char ch; char *search_name; clrscr(); Data_graph(); Data_Load(); i--; do { printf("\n\n\n\t功能选择:"); printf("\n\tPress 1 ——读取信息:"); printf("\n\tPress 2 ——创建信息:"); printf("\n\tPress 3 ——删除信息:"); printf("\n\tPress 4 ——查询信息:"); printf("\n\tPress 5 ——插入信息:"); printf("\n\tPress 6 ——保存信息"); printf("\n\tPress 7 ——退出"); printf("\n\n"); printf("\t选择:"); ch=getchar(); switch(ch) { case '1': j=1; while(getch()!=0&&j<=i) Data_Show(j++); if(j>i) printf("\n\tEnd of e_note\n"); break; case '2': while(getch()!=0&&i<N) { i++; Data_Input(i); if(i>2) printf("是否继续? Y/N"); ch=getch();if(ch==121) continue; if(ch==110) break;} if(i==N) printf("\ne file is filled\n"); break; case '3': if(i<1) { printf("\n没有记录!\n"); break;} printf("\nDelete N"); scanf("%d",&k); for(j=k;j<i;j++) { strcpy(students[j].name,students[j+1].name); students[j].sex=students[j+1].sex; students[j].birth.year=students[j+i].birth.year; students[j].birth.month=students[j+1].birth.month; students[j].birth.day=students[j+1].birth.day; students[j].score=students[j+1].score; } i--; break; case '4': printf("\n\t请输入姓名:"); gets(search_name); for(j=1;j<=i;j++) { if(strcmp(search_name,students[j].name)==0) { Data_Show(j); break; } if(j>i) printf("\n\t 对不起,没有该记录!"); break;} case '5': printf("\n\tInsert N"); scanf("%d",&k); for(j=i+1;j>k;j--) { strcpy(students[j].name,students[j-1].name); students[j].sex=students[j-1].sex; students[j].birth.year=students[j-1].birth.year; students[j].birth.month=students[j-1].birth.month; students[j].birth.day=students[j-1].birth.day; students[j].score=students[j-1].score; } Data_Input(k); i++; break; case '6': Data_Save(); exit(0); break; case '7': printf("\n\t是否保存?:(y/n)"); ch=getch(); if(ch='y') Data_Save(); fclose(fp); exit(0); default: printf("请选择:1—4\n"); } } while(1); Data_grapher();}


qq:69558139
2004-07-20 15:14
快速回复:请各位哥哥姐姐帮忙看看这个程序??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026113 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved