下面展示一些 内联代码片
。
// A code block
var foo = 'bar';
// An highlighted block
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_RESTAURANTS 100
#define MAX_USERS 100
// 定义结构体
typedef struct {
int CommentId;
int UserId;
int restaurantId;
char restaurantName[50];
char time[50];
char comment[100];
int rating;
char content[100];
char username[50];
} Comment;
typedef struct {
int restaurantId;
char name[50];
char introduction[100];
char phone[20];
char address[100];
int isOpen;
char openingHours[50];
int rating;
char description[200];
} Restaurant;
typedef struct {
int id;
char name[50];
char description[100];
char cuisine[50];
char type[50];
int weight;
float price;
} Dish;
typedef struct {
int age;
int UserId;
char username[50];
char name[50];
char password[50];
char realName[50];
char phone[20];
char hobby[50];
char address[100];
char remark[100];
char note[200];
} User;
// 初始化数据
Restaurant restaurants[100];
int restaurantCount = 0;
Dish dishes[1000];
int dishCount = 0;
User users[100];
int userCount = 0;
Comment comments[1000];
int commentCount = 0;
// 函数声明
//餐厅模块
void addRestaurant(Restaurant* restaurants, int* count);
void deleteRestaurant(Restaurant* restaurants, int* count);
void searchRestaurant(Restaurant* restaurants, int count);
void updateRestaurant(Restaurant* restaurants, int count);
void displayAllRestaurants(Restaurant* restaurants, int count);
void saveRestaurantsToFile(Restaurant* restaurants, int count);
void loadRestaurantsFromFile(Restaurant* restaurants, int* count);
//菜品模块
void addDish(Dish* dishes, int* count);
void deleteDish(Dish* dishes, int* count);
void searchDish(Dish* dishes, int count);
void updateDish(Dish* dishes, int count);
void saveDishesToFile(Dish* dishes, int count);
void displayAllDishes(Dish* dishes, int count);
void displayDishCount(int count);
void loadDishesFromFile(Dish* dishes, int* count);
//用户模块
void addUser(User* users, int* count);
void deleteUser(User* users, int* count);
void searchUser(User* users, int count);
void updateUser(User* users, int count);
void saveUsersToFile(User* users, int count);
void loadUsersFromFile(User* users, int* count);
//评价模块
void addComment(Comment* comments, int* commentCount, User* users, int userCount, Restaurant* restaurants, int restaurantCount);
void deleteComment(Comment* comments, int* count);
void searchComment(Comment* comments, int count);
void updateComment(Comment* comments, int count);
void saveCommentsToFile(Comment* comments, int count);
void printAllComments(Comment* comments, int commentCount);
void loadReviewsFromFile(Comment* comments, int* commentCount);
// 主函数