?? inchat.c
字號:
/* inchat.c SSI for Free Chat which simply spits out how many people are in chat right now. by Bill Kendrick kendrick@zippy.sonoma.edu http://zippy.sonoma.edu/kendrick/ June 3, 1997 - June 3, 1997 */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "readline.h"#include "myopen.h"int main(int argc, char * argv[]){ FILE * fi; char temp[1024], file[1024]; int in, z, simple; strcpy(file, "who.dat"); simple = 0; if (argc == 2 || argc == 3) { z = 1; if (argv[1][0] != '-') { strcpy(file, argv[1]); z = 2; } if (argc > z && strcmp(argv[z], "-simple") == 0) simple = 1; } in = 0; fi = myopen(file, "r"); if (fi != NULL) { do { readline(fi, temp); if (!feof(fi)) { in++; readline(fi, temp); readline(fi, temp); readline(fi, temp); readline(fi, temp); } } while (!feof(fi)); } if (simple == 0) { printf("There "); if (in == 0) printf("are no people"); else if (in == 1) printf("is one person"); else printf("%d people", in); printf(" in chat."); } else printf("%d", in);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -