C程式設計(譚浩強)第五版課後題答案 第九章

来源:https://www.cnblogs.com/lazyheartkx/archive/2022/05/18/16285105.html
-Advertisement-
Play Games

大家好,這篇文章分享了C程式設計(譚浩強)第五版第九章課後題答案,所有程式已經測試能夠正常運行,如果小伙伴發現有錯誤的的地方,歡迎留言告訴我,我會及時改正!感謝大家的觀看!!! ...


1.定義一個結構體變數(包括年、月、日)。計算該日在本年中是第幾天,註意閏年問題。

#include <stdio.h>

struct Date{
    int year;
    int month;
    int day;
};

int main()
{
    struct Date date;
    int i=0,no=0;
    int Month[12]={31,28,31,30,31,30,31,31,30,31,30,31};

    printf("請輸入日期(年、月、日):");
    scanf("%d %d %d",&date.year,&date.month,&date.day);

    no+=date.day;
    for(i=0;i<date.month-1;i++)
        no+=Month[i];

    if(date.year%4==0 && date.year%100!=0 || date.year%400==0)
        no+=1;

    printf("%d月%d日是%d年的第%d天!\n",date.month,date.day,date.year,no);
    return 0;
}

 

2.寫一個函數days,實現第1 題的計算。由主函數將年、月、日傳遞給days函數,計算後將日子數傳回主函數輸出。

#include <stdio.h>

struct Date{
    int year;
    int month;
    int day;
};

int main()
{
    struct Date date;
    int i=0,no;
    int days(struct Date date);

    printf("請輸入日期(年、月、日):");
    scanf("%d %d %d",&date.year,&date.month,&date.day);

    no=days(date);
    
    printf("%d月%d日是%d年的第%d天!\n",date.month,date.day,date.year,no);
    return 0;
}
int days(struct Date date)
{
    int i,no=0;
    int Month[12]={31,28,31,30,31,30,31,31,30,31,30,31};

    no+=date.day;
    for(i=0;i<date.month-1;i++)
        no+=Month[i];

    if(date.year%4==0 && date.year%100!=0 || date.year%400==0)
        no+=1;
    return no;
}

 

3.編寫一個函數print,列印一個學生的成績數組,該數組中有5個學生的數據記錄,每個記錄包括num,name,score[3],用主函數輸人這些記錄,用print函數輸出這些記錄。

#include <stdio.h>
#define M 20

struct student{
    int num;
    char name[M];
    int score[3];
};

int main()
{
    int i;
    struct student stu[5];
    void myprint(struct student stu[5]);

    printf("請按以下格式依次輸入5名學生的信息:\n");
    printf("num name score1 score2 score3\n");
    for(i=0;i<5;i++)
        scanf("%d %s %d %d %d",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);

    myprint(stu);

    return 0;
}
void myprint(struct student stu[5])
{
    int i;
    printf("num name score1 score2 score3\n");
    for(i=0;i<5;i++)
        printf("%3d %3s %3d %3d %3d\n",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}

 

4.在第3題的基礎上,編寫一個函數input,用來輸人5個學生的數據記錄。

#include <stdio.h>
#define M 20

struct student{
    int num;
    char name[M];
    int score[3];
};

int main()
{
    struct student stu[5];
    void myprint(struct student stu[5]);
    void input(struct student stu[5]);

    input(stu);
    myprint(stu);

    return 0;
}
void myprint(struct student stu[5])
{
    int i;
    printf("num name score1 score2 score3\n");
    for(i=0;i<5;i++)
        printf("%3d %3s %3d %3d %3d\n",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}

void input(struct student stu[5])
{
    int i;
    printf("請按以下格式依次輸入5名學生的信息:\n");
    printf("num name score1 score2 score3\n");
    for(i=0;i<5;i++)
        scanf("%d %s %d %d %d",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
}

 

5.有10個學生,每個學生的數據包括學號、姓名、3門課程的成績,從鍵盤輸人10個學生數據,要求輸出3門課程總平均成績,以及最高分的學生的數據(包括學號、姓名、3門課程成績、平均分數)。

#include <stdio.h>
#define M 10

struct student{
    int num;
    char name[20];
    int score[3];
};

int main()
{
    struct student stu[M];
    void myprint(struct student stu[M]);
    void input(struct student stu[M]);
    void max_aver(struct student stu[M]);

    input(stu);
    myprint(stu);
    max_aver(stu);

    return 0;
}
void myprint(struct student stu[M])
{
    int i;
    printf("num name score1 score2 score3\n");
    for(i=0;i<M;i++)
        printf("%3d %3s %3d %3d %3d\n",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}

void input(struct student stu[M])
{
    int i;
    printf("請按以下格式依次輸入%d名學生的信息:\n",M);
    printf("num name score1 score2 score3\n");
    for(i=0;i<M;i++)
        scanf("%d %s %d %d %d",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
}
void max_aver(struct student stu[M])
{
    int i,j,id,max;
    float sum;
    for(i=0;i<3;i++)
    {
        sum=0;
        max=0;
        for(j=0;j<M;j++)
        {
            sum+=stu[j].score[i];
            if(max<stu[j].score[i])
            {
                max=stu[j].score[i];
                id=j;
            }
        }
        printf("第%d門課的平均分是%.2f\n",i+1,sum/M);
        printf("第%d門課的最高分是%d\n",i+1,max);
        printf("這名學生的信息如下:\n");
        printf("num name score1 score2 score3\n");
        printf("%3d %3s %3d %3d %3d\n",stu[id].num,stu[id].name,stu[id].score[0],stu[id].score[1],stu[id].score[2]);
        printf("\n");
    }
}

 

6.13個人圍成一圈,從第1個人開始順序報號1,2,3。凡報到3者退出圈子。找出最後留在圈子中的人原來的序號。要求用鏈表實現。

解題思路:

創建一個環形鏈表,給鏈表中的每一個節點從1~13編號,然後開始淘汰過程,對於淘汰的節點,序號置為0,淘汰完成之後,找到序號不為0的即為最後留下的。

#include <stdio.h>
#define M 13

struct people{
    int num;
    struct people *next;
};

int main()
{
    int i,count;
    struct people peo[M],*head;
    head=peo;

    for(i=0;i<M;i++)
    {
        head->num =i+1;
        head->next=&peo[i+1];
        head=head->next;        
    }
    peo[M-1].next=peo;                        //最後一個元素指向第一個元素

    i=0;
    count=M;
    head=peo;
    while(count>1)
    {
        i++;
        if(head->num==0)
        {
            head=head->next;
            continue;
        }
        if(i==3)
        {
            printf("%d號被淘汰\n",head->num);
            head->num=0;
            count--;
            i=0;
        }
        head=head->next;
    }

    printf("\n");
    while(head->num==0)
    {
        head=head->next;
        if(head->num!=0)
            printf("最後留下的是%d號\n",head->num);
    }

    return 0;
}

 

7.在第9章例9.9和例9.10的基礎上,寫一個函數del,用來刪除動態鏈表中指定的節點

解題思路:

首先創建一個帶頭的單鏈表,然後讓用戶輸入需要刪除的節點,調用del函數,找到需要刪除的節點,把待刪除節點的前驅和後繼重新鏈接。

#include <stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct LNode)

struct LNode{
    long num;
    struct LNode *next;
};

int n;

int main()
{
    long m;
    struct LNode *pt;
    struct LNode * creat();
    void print(struct LNode * head);
    void del(struct LNode * head,long m);

    printf("建立鏈表(輸入0停止建立)\n");

    pt=creat();

    print(pt);


    printf("要刪除的節點是: \n");
    scanf("%ld",&m);

    del(pt,m);

    print(pt);

    return 0;
}

struct LNode * creat()
{
    struct LNode *head,*p1,*p2;
    head=(struct LNode *)malloc(LEN);
    n=0;
    p1=p2=(struct LNode *)malloc(LEN);

    printf("請輸入第1個數據:");
    scanf("%ld",&p1->num);
    printf("\n");

    head=NULL;

    while(p1->num!=0)
    {
        n=n+1;
        if(n==1)
            head=p1;
        else
            p2->next=p1;
        p2=p1;
        p1=(struct LNode *)malloc(LEN);
        printf("請輸入第%d個數據:",n+1);
        scanf("%ld",&p1->num);
        printf("\n");
    }
    p2->next=NULL;
    return(head);
}

void print(struct LNode * head)
{
    struct LNode *p;
    printf("鏈表的數據如下:\n");
    p=head;
    if(head!=NULL)
    do
    {
        printf("%ld ",p->num);
        p=p->next;
    }while(p!=NULL);
    printf("\n");
}

void del(struct LNode * head,long m)
{
    struct LNode *p1,*p2;
    if(head==NULL)
        printf("list null!\n");
    p1=head;

    while(p1->num!=m && p1->next!=NULL)
    {
        p2=p1;
        p1=p1->next;
    }
    if(p1->num==m)
    {
        if(p1==head)
            head=p1->next;
        else
            p2->next=p1->next;
        n=n-1;
    }
    else
        printf("%ld 未找到\n",m);
}

 

8.寫一個函數insert,用來向一個動態鏈表插入結點

#include <stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct LNode)

struct LNode{
    long num;
    struct LNode *next;
};

int n;

int main()
{
    int insert_id,insert0;
    struct LNode * creat(),*pt;
    void print(struct LNode * head);
    void insert(struct LNode * head,int insert_id,int insert0);

    printf("建立鏈表(輸入0停止建立)\n");

    pt=creat();
    print(pt);

    printf("請輸入要插入的位置以及數據:");
    scanf("%d %d",&insert_id,&insert0);
    
    insert(pt,insert_id,insert0);

    print(pt);

    return 0;
}

struct LNode * creat()
{
    struct LNode *head,*p1,*p2;
    head=(struct LNode *)malloc(LEN);
    n=0;
    p1=p2=(struct LNode *)malloc(LEN);

    printf("請輸入第1個數據:");
    scanf("%ld",&p1->num);
    printf("\n");

    head=NULL;

    while(p1->num!=0)
    {
        n=n+1;
        if(n==1)
            head=p1;
        else
            p2->next=p1;
        p2=p1;
        p1=(struct LNode *)malloc(LEN);
        printf("請輸入第%d個數據:",n+1);
        scanf("%ld",&p1->num);
        printf("\n");
    }
    p2->next=NULL;
    return(head);
}

void print(struct LNode * head)
{
    struct LNode *p;
    printf("鏈表的數據如下:\n");
    p=head;
    if(head!=NULL)
    do
    {
        printf("%ld ",p->num);
        p=p->next;
    }while(p!=NULL);
    printf("\n");
}

void insert(struct LNode * head,int insert_id,int insert0)
{
    struct LNode *p1,*p2;
    p1=head;

    insert_id-=1;
    while(--insert_id)
    {
        p1=p1->next;
    }
    
    p2=(struct LNode *)malloc(LEN);
    p2->num=insert0;
    p2->next=p1->next;
    p1->next=p2;
}

 

9.綜合本章例9.9(建立鏈表的函數creat)、例9.10(輸出鏈表的函數print)和本章習題第7題(刪除鏈表中結點的函數del)、第8題(插入結點的函數insert),再編寫一個主函數,先後調用這些函數。用以上5個函數組成一個程式,實現鏈表的建立、輸出、刪除和插入,在主函數中指定需要刪除和插人的結點的數據。

#include <stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct LNode)

struct LNode{
    long num;
    struct LNode *next;
};

int n;

int main()
{
    char c;
    int insert_id,insert0,m,flag=1;
    struct LNode * creat(),*pt;
    void print(struct LNode * head);
    void insert(struct LNode * head,int insert_id,int insert0);
    void del(struct LNode * head,long m);

    pt=creat();
    print(pt);
    
    while(flag==1)
    {
        printf("插入數據(1) 刪除數據(2) 結束(3):");
        getchar();
        scanf("%c",&c);
        
        if(c=='1')
        {
            printf("請輸入要插入的位置以及數據:");
            scanf("%d %d",&insert_id,&insert0);
            insert(pt,insert_id,insert0);
            print(pt);
        }
        if(c=='2')
        {
            printf("請輸入要刪除的數據:");
            scanf("%ld",&m);
            del(pt,m);
            print(pt);
        }
        if(c=='3')
            flag=0;
    }
    print(pt);

    return 0;
}

struct LNode * creat()
{
    struct LNode *head,*p1,*p2;
    head=(struct LNode *)malloc(LEN);
    n=0;
    p1=p2=(struct LNode *)malloc(LEN);

    printf("請輸入第1個數據:");
    scanf("%ld",&p1->num);
    printf("\n");

    head=NULL;

    while(p1->num!=0)
    {
        n=n+1;
        if(n==1)
            head=p1;
        else
            p2->next=p1;
        p2=p1;
        p1=(struct LNode *)malloc(LEN);
        printf("請輸入第%d個數據:",n+1);
        scanf("%ld",&p1->num);
        printf("\n");
    }
    p2->next=NULL;
    return(head);
}

void print(struct LNode * head)
{
    struct LNode *p;
    printf("鏈表的數據如下:\n");
    p=head;
    if(head!=NULL)
    do
    {
        printf("%ld ",p->num);
        p=p->next;
    }while(p!=NULL);
    printf("\n");
}

void insert(struct LNode * head,int insert_id,int insert0)
{
    struct LNode *p1,*p2;
    p1=head;

    insert_id-=1;
    while(--insert_id)
    {
        p1=p1->next;
    }
    
    p2=(struct LNode *)malloc(LEN);
    p2->num=insert0;
    p2->next=p1->next;
    p1->next=p2;
}
            
void del(struct LNode * head,long m)
{
    struct LNode *p1,*p2;
    if(head==NULL)
        printf("list null!\n");
    p1=head;

    while(p1->num!=m && p1->next!=NULL)
    {
        p2=p1;
        p1=p1->next;
    }
    if(p1->num==m)
    {
        if(p1==head)
            head=p1->next;
        else
            p2->next=p1->next;
        n=n-1;
    }
    else
        printf("%ld 未找到\n",m);
}

 

10.已有a,b兩個鏈表,每個鏈表中的結點包括學號、成績。要求把兩個鏈表合併, 按學號升序排列。

#include <stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct student)

struct student{
    int num;
    double grade;
    struct student *next;
};

int main()
{
    int i;
    struct student a[4]={{1,99},{2,98.5},{5,99.1},{6,99.2}};
    struct student b[5]={{3,99.3},{4,99.4},{9,99.6},{7,99.7},{8,99.8}};
    struct student *Merge( struct student *L1,struct student *L2 );
    struct student *head1,*head2,*p1,*p2,*p;

    head1=a;
    head2=b;

    printf("a鏈表的數據如下:\n");
    p1=head1;
    for(i=1;i<=4;i++)
    {
        if(i<4)
            p1->next=a+i;
        else
            p1->next=NULL;
        printf("%d %.2lf\n",p1->num,p1->grade);
        if(i<4)
            p1=p1->next;
    }

    printf("b鏈表的數據如下:\n");
    p2=head2;
    for(i=1;i<=5;i++)
    {
        if(i<5)
            p2->next=b+i;
        else
            p2->next=NULL;
        printf("%d %.2lf\n",p2->num,p2->grade);
        if(i<5)
            p2=p2->next;
    }

    p=Merge(head1,head2);
    printf("排序後的鏈表如下:\n");
    while(p!=NULL)
    {
        printf("%4d %7f  \n",p->num,p->grade);
        p=p->next;
    }
    return 0;
}

struct student *Merge(struct student *a,struct student *b)
{
    int num;
    double grade;
    struct student *head,*pre;
    head=a;
    while(a->next!=NULL)
        a=a->next;
    a->next=b;
    pre=head;
    while(pre->next!=NULL)
    {
        a=pre->next;
        while(a!=NULL)
        {
            if(pre->num > a->num)
            {
                num=pre->num;
                grade=pre->grade;
                pre->num=a->num;
                pre->grade=a->grade;
                a->num=num;
                a->grade=grade;
            }
            a=a->next;
        }
        pre=pre->next;
    }
    return head;
}

 

11.有兩個鏈表a和b,設結點中包含學號、姓名。從a鏈表中刪去與b鏈表中有相同學號的那些結點。

解題思路:

對於b鏈表中的每一個節點,都從a鏈表的表頭開始查找,如果可以找到,直接刪除,如果找不到,繼續從a鏈表表頭找下一個b的節點。

 

#include <stdio.h>
#include <string.h>
#define LA 4
#define LB 5
struct  student{
    int num;
    char name[8];
    struct student *next;
} a[LA],b[LB];

int main()
{
    struct student a[LA]={{101,"Wang"},{102,"Li"},{105,"Zhang"},{106,"Wei"}};
    struct student b[LB]={{103,"Zhang"},{104,"Ma"},{105,"Chen"},{107,"Guo"},{108,"lui"}};
    int i;
    struct student *p,*p1,*p2,*head1,*head2;

    head1=a;
    head2=b;
    printf(" list A:  \n");
    p1=head1;
    for(i=1;i<=LA;i++)
    {
        if(i<LA) 
            p1->next=a+i;
        else 
            p1->next=NULL;
        printf("%4d%8s\n",p1->num,p1->name);
        if(i<LA) 
            p1=p1->next;
    } 
    printf("\n list B:\n");
    p2=head2;
    for(i=1;i<=LB;i++)
    {
        if(i<LB) 
            p2->next=b+i;
        else 
            p2->next=NULL;
        printf("%4d%8s\n",p2->num,p2->name);
        if(i<LB) 
            p2=p2->next;
    }

    p1=head1;
    while(p1!=NULL)
    {
        p2=head2;
        while((p1->num != p2->num) && (p2->next!=NULL))        //p1與p2的值依次比較
            p2=p2->next;
        if(p1->num == p2->num)                                //p1=p2時
        {
            if(p1==head1)
                head1=p1->next;
            else
            {
                p->next=p1->next;
                p1=p1->next;
            }
       }
        else        //比較到結束,p1與p2沒有相同的
        {
            p=p1;
            p1=p1->next;
        }
    }

    printf("\nresult:\n");
    p1=head1;
    while(p1!=NULL)
    {
        printf("%4d %7s  \n",p1->num,p1->name);
        p1=p1->next;
    }
    return 0;
}

 

12.建立一個鏈表,每個結點包括:學號、姓名、性別、年齡。輸入一個年齡,如果鏈表中的結點所包含的年齡等於此年齡,則將此結點刪去。

#include <stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct student)

struct student{
    int num;
    char name[20];
    char sex[6];
    int age;

    struct student *next;
};

int n;

int main()
{
    int years;
    struct student * creat(),*pt;
    void print(struct student * head);
    void del(struct student * head,int delage);

    pt=creat();
    print(pt);

    printf("請輸入要刪除的年齡:");
    scanf("%d",&years);

    del(pt,years);
    print(pt);

    return 0;
}

struct student * creat()
{
    struct student *head,*p1,*p2;
    head=(struct student *)malloc(LEN);
    n=0;
    p1=p2=(struct student *)malloc(LEN);

    printf("請按以下格式輸入每名學生的信息(輸入0 停止錄入):\n");
    printf("num name sex age");
    printf("請輸入第1個學生信息:");
    scanf("%d%s%s%d",&p1->num,p1->name,p1->sex,&p1->age);
    printf("\n");

    head=NULL;

    while(p1->num!=0)
    {
        n=n+1;
        if(n==1)
            head=p1;
        else
            p2->next=p1;
        p2=p1;
        p1=(struct student *)malloc(LEN);
        printf("請輸入第%d個同學信息:",n+1);
        scanf("%d%s%s%d",&p1->num,p1->name,p1->sex,&p1->age);
        printf("\n");
    }
    p2->next=NULL;
    return(head);
}

void print(struct student * head)
{
    struct student *p;
    printf("鏈表的數據如下:\n");
    p=head;
    if(head!=NULL)
    do
    {
        printf("%3d %3s %3s %3d\n",p->num,p->name,p->sex,p->age);
        p=p->next;
    }while(p!=NULL);
    printf("\n");
}

void del(struct student * head,int delage)
{
    struct student *p1,*p2;
    if(head==NULL)
        printf("list null!\n");
    p1=head;

    while(p1->age!=delage && p1->next!=NULL)
    {
        p2=p1;
        p1=p1->next;
    }
    if(p1->age==delage)
    {
        if(p1==head)
            head=p1->next;
        else
            p2->next=p1->next;
    }
    else
        printf("%d 未找到\n",delage);
}

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 知識回顧 解析完Bean信息的合併,可以知道Spring在實例化Bean之後,屬性填充前,對Bean進行了Bean的合併操作,這裡的操作主要做了對Bean對象標記了@Autowired、@Value、@Resource、@PostConstruct、@PreDestroy註解的欄位或者方法進行解析, ...
  • Cookied的設置會造成XSS攻擊,所以出現了防禦機制HttpOnly標誌(可選),客戶端腳本將無法訪問cookie(如果瀏覽器支持該標誌的話)。因此即使客戶端存在跨站點腳本(XSS)漏洞,瀏覽器也不會將Cookie透露給第三方。Cookie和Session後面還會設計到xss和csrf漏洞的利用... ...
  • 為了修複生產數據,需要執行一段一次性的代碼。 鑒於是spring老項目,就想到了InitializingBean。 代碼如下。服務啟動後,log里發現出現2條“一次性任務開始”。 好在裡面邏輯做了防重控制,沒有受到什麼影響。 @Slf4j @Component public class TransT ...
  • 什麼是隱藏類 隱藏類,是一種不能被其他類直接使用的類。引入隱藏類的主要目的是給框架來使用,使得框架可以在運行時生成類,並通過反射間接使用它們。可能有點抽象,不要緊,下麵我們通過一個例子來直觀的認識它! 隱藏類案例 第一步:先創建一個普通的Java類 public class JEP371Hidden ...
  • 下麵介紹的是JUC包下一些線程安全類的一些簡單使用和一些小demo。 Semaphore 信號量,即可以同時使用的線程數,tryrequire就是將信號量減一,release就是信號量+1,當等於0就會阻塞,大於零才會喚醒。 當需要控制線程訪問數量,可以使用信號量來做控制,比較簡單。 下麵是使用信號 ...
  • Spring Ioc源碼分析系列--Ioc容器註冊BeanPostProcessor後置處理器以及事件消息處理 前言 上一篇分析了BeanFactoryPostProcessor的作用,那麼這一篇繼續在refresh()方法里游蕩,相信對Spring熟悉點的朋友,在看完BeanFactoryPost ...
  • 大家好,這篇文章分享了C程式設計(譚浩強)第五版第十章課後題答案,所有程式已經測試能夠正常運行,如果小伙伴發現有錯誤的的地方,歡迎留言告訴我,我會及時改正!感謝大家的觀看!!! ...
  • 高精度 運算:加法、減法、階乘、乘法 翻轉: 這些運算都是從小位開始,所以一般需要翻轉。以字元串儲存:reverse(a.begin(),a,end())。以數組儲存: for (int i1 = lena1 - 1; i1 >= 0; i1--) { a1[lena1-1-i1] = a[i1] ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...