Quantcast
Channel: Programmer's Town -
Viewing all articles
Browse latest Browse all 5

Re:

$
0
0

upd: brushed names of macroes, added . Ears, by the way, grow . : #include "string.h" #include "stdio.h" #define QUOTE (name) #name #define STR (macro) QUOTE (macro) #define CHECK_FUN_TEXT STR (CHECK_FUN) #define CHECK_FUN int check (const char *s) {char line [1024]; gets (line); if (strcmp (line, "#include \" string.h \"")) {printf ("bad 1 (%s) \n", line); return 1;} gets (line); if (strcmp (line, "#include \" stdio.h \"")) {printf ("bad 2 (%s) \n", line); return 2;} gets (line); if (strcmp (line, "#define QUOTE (name) #name")) {printf ("bad 3 (%s) \n", line); return 3;} gets (line); if (strcmp (line, "#define STR (macro) QUOTE (macro)")) {printf ("bad 4 (%s) \n", line); return 4;} gets (line); if (strcmp (line, "#define CHECK_FUN_TEXT STR (CHECK_FUN)")) {printf ("bad 5 (%s) \n", line) gets (line); if (strstr (line, "#define CHECK_FUN")! =line) {printf ("bad 6 (' %s')\n", line); return 6;} if (strcmp (line+18, s)) {printf ("bad 6x (' %s')\n", line+18); return 6;} gets (line); if (strcmp (line, "CHECK_FUN int main () {return check (CHECK_FUN_TEXT);}")) {printf ("bad 7 (%s) \n", line); return 7;} printf ("good\n"); return 0;} CHECK_FUN int main () {return check (CHECK_FUN_TEXT);} : #include "stdio.h" #define QUOTE (name) #name #define STR (macro) QUOTE (macro) #define QUINE_FUN_TEXT STR (QUINE_FUN) #define QUINE_FUN int quine (const char *s) {printf ("#include \" stdio.h \"\n"); printf ("#define QUOTE (name) #name \n"); printf ("#define STR (macro) QUOTE (macro) \n"); printf ("#define QUINE_FUN_TEXT STR (QUINE_FUN) \n"); printf ("#define QUINE_FUN %s\n", s); printf ("QUINE_FUN int main ( \n "); return 0;} QUINE_FUN int main () {return quine (QUINE_FUN_TEXT);}


Viewing all articles
Browse latest Browse all 5

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes