rip.c

来自「并行解法器,功能强大」· C语言 代码 · 共 48 行

C
48
字号
/*==================================================================== * ------------------------ * | CVS File Information | * ------------------------ * * $RCSfile: rip.c,v $ * * $Author: tuminaro $ * * $Date: 1996/01/22 19:52:37 $ * * $Revision: 1.1 $ * * $Name:  $ *====================================================================*/#include <stdio.h> main(argc, argv)int argc;char *argv[]; {   char first,second,third;  int count = 0;  int request;  int first_int;  char str[80];  int  max = 8;  sprintf(str,"#!/bin/sh");  count = 0;  while ( (first_int = getchar()) != EOF ) {    first = (char)first_int;    if ( first == str[count]) count++;    else count = 0;    if (count == max) break;  }  if (count == max) {     for (count = 0 ; count < max ; count++) putchar(str[count]);     while ( (first_int = getchar()) != EOF ) {        putchar(first_int);     }  }}

⌨️ 快捷键说明

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