查看單個文章
舊 2010-03-03, 06:24 PM   #3 (permalink)
ccutmis
註冊會員
榮譽勳章

勳章總數0
UID - 335908
在線等級: 級別:2 | 在線時長:12小時 | 升級還需:9小時級別:2 | 在線時長:12小時 | 升級還需:9小時
註冊日期: 2010-01-22
文章: 15
精華: 0
現金: 40 金幣
資產: 140 金幣
預設 try it~能用當作揀到吧

底下是從網路上抄來的,也不知道合不合用,
因為太久沒碰C&C++了,電腦也沒編譯器可用....


#include<conio.h>
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#define TRUE 1

void menu(void);
void add(void);
void list(void);
void mod(void);
void search(void);
void del(void);
void quit(void);

struct my_struct
{
int studentid;
char studentname[20];
char ic[10];
int age;
char dob[10];
char address[50];
char phone[20];
char email[20];
char password[7],userpw;
}s1;

FILE *stream;

void main(void)
{

char password[7] = "sas";
char userpw[7];

int i = 1;
for(i=0;i<3;i++)
{
clrscr();
printf("\n");
printf("\n\t\tWelcome to Student Administration System ");
printf("\n\t\t****************************************");
printf("\n");
printf("\n\t\tEnter Password: ");
gets(userpw);

if(strcmp(password,userpw) == 0)
menu();
else
printf("\n\t\tInvalid password ! Pls Try Again: _ ");
getch();


} }

來源網址:
http://www.dreamincode.net/forums/showtopic57944.htm
ccutmis 目前離線  
送花文章: 0, 收花文章: 12 篇, 收花: 17 次
回覆時引用此帖