Originally Posted by
Salem
Which compiler are you using.
Show us the 10 or so lines of code you use to just print the menu.
Sorry, my internet connection lost these days
Here is the code
Code:
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
#include<windows.h>
typedef struct {
unsigned int Ngay , Thang , Nam;
} Date;
typedef struct {
char FirstName[20];
char LastName[10];
} Name;
typedef struct {
Name ten;
char maLop[10];
char masinhvien[10];
Date dob;
float diemtrungbinhtichluy;
} SinhVien;
void M1(){
}
void Writefile(char *file){
FILE *f;
int n,i;
}
void M2(){
system("cls");
printf("+--------------------------------+DANH SACH SINH VIEN+---------------------------+\n\n");
printf("+------------------+--------------+-------------------+-----------------+--------+\n");
printf("| Ho Va Ten | Ma Lop | Ma Sinh vien | Ngay Sinh | DTB |\n");
printf("+------------------+--------------+-------------------+-----------------+--------+\n");
printf("+------------------+--------------+-------------------+-----------------+--------+\n");
getch();
}
void sapxep_key(){
system("cls");
printf("Cac khoa sap xep:\n");
printf("1.Ten\n");
printf("2.Ngay sinh\n");
printf("3.Diem TB\n");
printf("Enter your choice: ");
int temp;
scanf("%d",&temp);
getch();
}
void M3(){
system("cls");
printf("1.Sap xep chon\n");
printf("2.Sap xep noi bot\n");
printf("3.Sap xep nhanh\n");
printf("Enter your choice: ");
int temp;
scanf("%d",&temp);
switch(temp){
case 1:{
sapxep_key();
break;
}
case 2:{
sapxep_key();
break;
}
case 3:{
sapxep_key();
break;
}
getch();
}
}
void timkiem_key(){
system("cls");
printf("Cac khoa tim kiem:\n");
printf("1.Ten\n");
printf("2.Ngay sinh\n");
printf("3.Diem TB\n");
printf("Enter your choice: ");
int temp;
scanf("%d",&temp);
getch();
}
void M4(){
system("cls");
printf("1.Tim kiem tuan tu\n");
printf("2.Tim kiem nhi phan\n");
printf("Enter your choice: ");
int temp;
scanf("%d",&temp);
switch(temp){
case 1:{
timkiem_key();
break;
}
case 2:{
timkiem_key();
break;
}
getch();
}
}
void M5(){
system("cls");
printf("1.Thong ke so luong SV theo lop\n");
printf("2.Thong ke phan loai ket qua hoc tap\n");
printf("Enter your choice: ");
int temp;
scanf("%d",&temp);
switch(temp){
case 1:{
break;
}
case 2:{
break;
}
}
getch();
}
int main(){
Sinhvien sv;
int temp;
do{
printf("====MENU QLSV====\n");
printf("1.Them moi ho so\n");
printf("2.In danh sach\n");
printf("3.Sap xep\n");
printf("4.Tim kiem\n");
printf("5.Thong ke\n");
printf("0.Thoat\n");
printf("Enter your choice: ");
scanf("%d",&temp);
switch(temp){
case 1:{
M1();
break;
}
case 2:{
M2();
system("cls");
break;
}
case 3:{
system("color 3");
M3();
system("cls");
break;
}
case 4:{
M4();
system("cls");
break;
}
case 5:{
M5();
system("cls");
break;
}
case 0:
break;
}
}while(temp!=0);
getch();
return 0;
}
I tried to use windows.h library, but don't know what to do? pls help me