【激突】関数型言語 VS オブジェクト指向言語2at TECH【激突】関数型言語 VS オブジェクト指向言語2 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト400:デフォルトの名無しさん 12/04/15 11:57:38.79 >>399 ThreadLocalが一番エレガントって どういうセンスしてんだよ 401:デフォルトの名無しさん 12/04/15 12:04:48.59 #include <stdio.h> #include <string.h> int v,w,t;char buf[4<<10];void*fizz(void*n){if(!t&&!v){v=(int)n;t=!t;} if(!(v%3))goto a;else if(!(w&0x7))goto b;else goto c;a:{size_t (*f)(char*restrict,const char*restrict,size_t);f=(w&0x7)?strlcat :strlcpy;w|=0x1;f(buf,"Fizz",4<<10);}goto c;b:{char b[2<<8];;;;;;;;;;; snprintf(b,2<<8,"%d",v);strlcpy(buf,b,2<<8);}goto c;c:return buf;}void *buzz(void*n){if(!t&&!v){v=(int)n;t=!t;}if(!(v%5))goto a;else if(!(w&0x7))goto b;else goto c;a:{size_t/**/(*f)(char*restrict,const char*restrict,size_t);f=(w&0x7)?strlcat:strlcpy;w|=0x2;f(buf,"Buzz", 4<<10);}goto c;b:{char b[2<<8];snprintf(b,2<<8,"%d",v);strlcpy(buf,b, 2<<8);}goto c;c:return buf;}void*gizz(void*n){if(!t&&!v){v=(int)n;t=!t;} if(!(v%7))goto a;else if(!(w&0x7))goto b;else goto c;a:{size_t (*f) (char*restrict,const char*restrict,size_t);f=(w&0x7)?strlcat:strlcpy; w|=0x1;f(buf,"Gizz",4<<10);}goto c;b:{char b[2<<8];;;snprintf(b,2<<8, "%d",v);strlcpy(buf,b,2<<8);}goto c;c:return buf;}int main(void){printf ("%s\n",gizz(buzz(fizz(105))));} 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch