1.c语言粮油进销存系统源代码
2.threejs——商场楼宇室内导航系统
c语言粮油进销存系统源代码
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
//日期结构体
typedef struct
{
int year;
int month;
int day;
}DATE;
//商品结构体
//定义链表
typedef struct Node
{
long num;
char name[];
char kind[];
DATE pro_date;
int save_day;
int shuliang;
float jinjia;
float shoujia;
DATE sale_date;
struct Node *next;
}Node,商场商场临床病例源码*LinkList;
//申请函数
void apply()
{
int i,flag=1;
FILE *fp;
char name[],key[];
flushall();
printf("用户名(不能为空):");
scanf("%s",name);
flushall();
printf("密码(不能为空):");
for(i=0;i<=;i++)
{
key[i]=getch();
if(key[i]==)
{
key[i]='\0';
break;
}
printf("*");
}
fp=fopen("key.txt","w");
if(fp==NULL)
{
printf("the file can not open!");
flag=0;
exit(1);
}
fprintf(fp,"%s %s",name,key);
fclose(fp);
if(flag==1)
printf("\n申请成功,请登录!\n");
else
printf("\n申请失败,请重新申请!\n");
}
//登录函数
int load()
{
FILE *fp;
int i;
char name[],key[];
char name1[],key1[];
fp=fopen("key.txt","r");
fscanf(fp,"%s %s",name,key);
fclose(fp);
printf("用户名(不能为空):");
scanf("%s",name1);
flushall();
printf("密码(不能为空):");
for(i=0;i<=;i++)
{
key1[i]=getch();
if(key1[i]==)
{
key1[i]='\0';
break;
}
printf("*");
}
printf("\n");
if(strcmp(name1,name)==0&&strcmp(key1,key)==0)
{ printf("登陆成功!\n\n");return 1; }
else
{ printf("用户名或密码错误;请重新登录!"); return 0;}
}
//密码保护系统
void key()
{
int choice,c;
do
{ printf("\n
2024-11-30 11:45
2024-11-30 11:03
2024-11-30 10:40
2024-11-30 10:33
2024-11-30 10:00
2024-11-30 09:45