All pastes #353486 Raw Edit

Untitled

public c v1 · immutable
·published 2007-02-13 11:47 UTC
rendered paste body
#include <stdio.h>enum eState {	CODE = 0,	STRING,	BSLASH,	SLASH1,	SLASH2};int main(){	int status = CODE;	int c = 0;	do{		c = getc(stdin);				switch (status){		case CODE : switch(c){						case '/' : status = SLASH1; break;						case '"' : status = STRING; break;											} break;		case STRING : switch(c){						case '\\' : status = BSLASH; break;						case '"' : status = CODE; break;					} break;		case BSLASH : status = STRING; break;		case SLASH1 : switch(c){												case '/' : status = SLASH2; break;												default: status = CODE;					} break;		case SLASH2 : switch(c){											case '\n' : status = CODE;					} printf("%c",c); break;		}	}while(c != EOF);	return 0;}