#实习心态崩了# 没有工资,自己出来租房,学校那边还交学费和住宿费,不管我们学生实习的学校远不远领导还想啥都让我干,今天还给他改表格等等一些杂事,我真的要疯了,学校老师又催论文。崩溃
全部评论
实习生太不容易了
点赞 回复 分享
发布于 09-12 10:18 陕西

相关推荐

09-17 14:29
哪位大神能帮我看一下,这段代码为什么在vscode中编译不了,直接跳出结束,无法输入输出#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#define MAX_WORDS 100000#define MAX_LEN 100001typedef struct {char *word;int count;}WordFreq;int cmp_str(const void* a,const void* b){return strcmp(*(const char**)a,*(const char**)b);}int cmp_freq(const void* a,const void* b){const WordFreq* wa=(const WordFreq*)a;const WordFreq* wb=(const WordFreq*)b;if(wa->count!=wb->count){return wb->count-wa->count;}return strcmp(wa->word,wb->word);}int main(){char input[MAX_LEN];fgets(input,sizeof(input),stdin);input[strcspn(input,"\n")]='\0';char* words[MAX_WORDS];int wordCount=0;char* token=strtok(input," ");while(token!=NULL&&wordCount<MAX_WORDS){words[wordCount++]=token;token=strtok(NULL," ");}if(wordCount==0) return 0;qsort(words,wordCount,sizeof(char*),cmp_str);WordFreq freqs[MAX_WORDS];int freqCount=0;int i=0;while(i<wordCount){int j=i;while(j<wordCount&&strcmp(words[i],words[j])==0){j++;}int count=j-i;if(count>=3){freqs[freqCount].word=words[i];freqs[freqCount].count=count;freqCount++;}i=j;}qsort(freqs,freqCount,sizeof(WordFreq),cmp_freq);for(int i=0;i<freqCount;i++){printf("%s\n",freqs[i].word);}return 0;}
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务