jq可以传值给mui页面吗? - 爱问答

(爱问答)

jq可以传值给mui页面吗?

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

const int MAXSIZE = 128;  // 每个单词不超过128个字符

typedef struct node {

   char word[MAXSIZE];

   int size;

   struct node *next;

}*List,*pNode;

List Init() {

   List head;

   head = (pNode)malloc(sizeof(struct node));

   head->size = 0;

   head->word[0] = '';

   head->next = NULL;

   return head;

}

char *toLower(char s[]) { // 小写变大写

   int i = 0;

   while(s[i]) {

       if(s[i] >= 'A' && s[i] <= 'Z')

           s[i] +=  'a' - 'A';

       ++i;

   }

   return s;

}

void Add(List head,char s[]) { // 添加到链表中

   pNode p = head;

   char t[MAXSIZE];

   strcpy(t,toLower(s));

   while(p->next) {

       if(strcmp(p->next->word,t) == 0) {

           ++p->next->size;

           return;

       }

       p = p->next;

   }

   p->next = (pNode)malloc(sizeof(struct node));

   strcpy(p->next->word,t);

   p->next->size = 1;

   p->next->next = NULL;

}

void Sort(List head) { // 根据各个词的数量排序(大到小)

   pNode p,q,qt;

   char ct[MAXSIZE];

   int it;

   for(p = head; p->next; p = p->next) {

       qt = p;

       for(q = p->next; q->next; q = q->next) {

           if(strlen(qt->next->word) < strlen(q->next->word))

               qt = q;

       }

       if(p != qt) {

           strcpy(ct,p->next->word);

           strcpy(p->next->word,qt->next->word);

           strcpy(qt->next->word,ct);

           it = qt->next->size;

           qt->next->size = p->next->size;

           p->next->size = it;

       }

   }

}

void Show(List head, int n,FILE *fp) { // 显示前n个

   int i;

   pNode p = head->next;

   for(i = 0; p; ++i) {

       fprintf(fp,"%s ",p->word);

       if(i < n) printf("%3d : %s ",p->size,p->word);

       p = p->next;

   }

}

int main() {

   char word[MAXSIZE];

   List head = Init();

   FILE *fin = fopen("data.txt","rt");

   FILE *fout = fopen("result.dat","wt");

   List list = Init();

   if(fin == NULL || fout  == NULL) {

       printf("不能打开数据文件。 ");

       return 1;

   }

   while(fscanf(fin,"%s",word) == 1)

       Add(head,word);

   fclose(fin);

   Show(head,3,fout);

   fclose(fout);

   return 0;

}


下一篇:time库包括几类函数?总共有多少个分别写出来,如何使用呢?

上一篇:怎么在html中建立相对站点

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?