iT邦幫忙

0

Day23 C程式🗂️ analysis.c

c
  • 分享至 

  • xImage
  •  

🗂️ analysis.c

#include "analysis.h"
#include <stdio.h>

void saveResult(int algorithm, int path, int expanded, double time) {
    FILE *fp = fopen("result.txt", "a");
    const char *name = (algorithm == 1) ? "DFS" :
                       (algorithm == 2) ? "BFS" : "A*";
    fprintf(fp, "%s %d %d %.2f\n", name, path, expanded, time);
    fclose(fp);
}

圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言