⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 squash.c

📁 编程珠玑第二版源码 很好的源码 编程珠玑第二版源码 很好的源码
💻 C
字号:
/* Copyright (C) 1999 Lucent Technologies */
/* From 'Programming Pearls' by Jon Bentley */

/* squash.c -- print anagram classes on a single line    The input lines "opst pots" and "opst stop" go to "pots stop" */#include <stdio.h>#include <stdlib.h>#include <string.h>#define WORDMAX 100int main(){   char word[WORDMAX], sig[WORDMAX], oldsig[WORDMAX];    int linenum = 0;    strcpy(oldsig, "");    while (scanf("%s %s", sig, word) != EOF) {        if (strcmp(oldsig, sig) != 0 && linenum > 0)            printf("\n");        strcpy(oldsig, sig);        linenum++;        printf("%s ", word);    }    printf("\n");
    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -