{"id":2436,"date":"2011-06-25T23:50:00","date_gmt":"2011-06-25T14:50:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=1166"},"modified":"2011-06-25T23:50:00","modified_gmt":"2011-06-25T14:50:00","slug":"blogn-1166","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=1166","title":{"rendered":"C\u306e\u5236\u5fa1\u69cb\u9020\u3082Perl\u306b\u898b\u7fd2\u304a\u3046"},"content":{"rendered":"<p>\u4eca\u65e5\u3082\u7d44\u307f\u8fbc\u307f\u306e\u8b1b\u5ea7\u3078\u3002<\/p>\n<p>\u4eca\u65e5\u304b\u3089\u30de\u30a4\u30b3\u30f3\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u30c7\u30a3\u30b8\u30bf\u30eb\u5165\u51fa\u529b\u306b\u3064\u3044\u3066\u4e00\u901a\u308a\u3002<\/p>\n<hr \/>\n<p> \u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u5206\u3067\u3044\u3058\u3044\u3058\u3057\u3066\u904a\u3093\u3067\u308b\u4eba\u3082\u3044\u305f\u304c\u3001\u307e\u305a\u306f\u30b5\u30f3\u30d7\u30eb\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5199\u3059\u3068\u3053\u308d\u304b\u3089\u306f\u3058\u307e\u308b\u3002<\/p>\n<p>\u305f\u3060\u3001\u305d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u7d1b\u3089\u308f\u3057\u3044\u3082\u306e\u3082\u3042\u3063\u305f\u3002<\/p>\n<pre>void wait(int time){\n  int i,j;\n  for(i=0;i&lt;time;i++)\n    for(j=0;j&lt;250;j++);\n}<\/pre>\n<p>\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3060\u304c\u3001\u5199\u3059\u6642\u306b\u30bb\u30df\u30b3\u30ed\u30f3\u3092\u6b63\u3057\u304f\u4ed8\u3051\u306a\u3044\u3068\u5168\u304f\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3002<\/p>\n<p>\u3064\u307e\u3065\u3044\u3066\u3044\u308b\u3072\u3068\u591a\u6570\u3002\u307e\u3041\u3042\u307e\u308a\u306b\u3057\u3087\u3046\u3082\u306a\u3044\u30df\u30b9\u306a\u306e\u3067\u3061\u3087\u3063\u3068\u8a00\u3048\u3070\u308f\u304b\u3063\u3066\u304f\u308c\u308b\u3051\u3069\u3002<\/p>\n<hr \/>\n<p>\u3053\u306e2\u91cdfor\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u66f8\u3051\u3070\u3001<\/p>\n<pre>fot(i=0;i&lt;time;i++){\n  for(j=0;j&lt;250;j++){}\n}<\/pre>\n<p>\u3068\u306a\u308b\u304b\u306a\u3002<\/p>\n<p>1\u3064\u76ee\u306efor\u306f{ }\u5185\u304c1\u6587\u3060\u3051\u3060\u304b\u3089{ }\u3092\u7701\u7565\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>2\u3064\u76ee\u306efor\u306f{ }\u5185\u304c\u306a\u306b\u3082\u3057\u306a\u3044\u3068\u3044\u3046\u6587\u306a\u306e\u3067\u3001;\u3060\u3051\u66f8\u3044\u3066\u3044\u308b\u3068\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u3053\u308c\u3092\u6b63\u3057\u304f\u7406\u89e3\u3057\u3066\u3044\u308b\u4eba\u306f\u3069\u308c\u3050\u3089\u3044\u308b\u306e\u3060\u308d\u3046\u304b\u3068\u3044\u3046\u7591\u554f\u304c\u3042\u308b\u3002<\/p>\n<hr \/>\n<p>\u3053\u3053\u3067Perl\u306f\u660e\u5feb\u3060\u306a\u3068\u601d\u3046\u308f\u3051\u3067\u3042\u308b\u3002<\/p>\n<p>Perl\u3067\u306fif,for,while\u306a\u3069\u306e{ }\u306f\u7701\u7565\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>\u307e\u3041Perl\u306b\u306f\u5f8c\u7f6eif\u3068\u304b\u3042\u308b\u3051\u3069\u3001\u305d\u3046\u3044\u3046\u306e\u306f\u4f7f\u308f\u306a\u3044\u3068\u3059\u308c\u3070\u305d\u3046\u306a\u308b\u3002<\/p>\n<p>\u305d\u308c\u3067C\u306eelse if\u306b\u76f8\u5f53\u3059\u308b\u3082\u306e\u306felsif\u3068\u3044\u3046\u7279\u5225\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>C\u3067\u306e else if( ){ } \u3068\u3044\u3046\u306e\u306f\u3001else{ if( ){ } } \u3068\u89e3\u91c8\u3055\u308c\u3066\u308b\u304b\u3089\u3044\u3044\u3093\u3060\u3051\u3069\u3001Perl\u3067\u306f\u3053\u308c\u304c\u3067\u304d\u3093\u304b\u3089\u3002<\/p>\n<hr \/>\n<p>\u3082\u3061\u308d\u3093{ }\u3092\u7701\u7565\u3067\u304d\u308b\u304a\u304b\u3052\u3067\u3046\u308c\u3057\u3044\u3053\u3068\u3082\u3042\u308b\u3002<\/p>\n<pre>if(i&lt;0)       return -1;\nelse if(i==0) return  0;\nelse          return +1;<\/pre>\n<p>\u3053\u3046\u3044\u3046\u3053\u3068\u306f\u3088\u304f\u3084\u308b\u3088\u306d\u30021\u884c\u3067\u307e\u3068\u3081\u3066\u66f8\u3051\u3070\u30b3\u30f3\u30d1\u30af\u30c8\u3067\u8aad\u307f\u3084\u3059\u304f\u3066\u3044\u3044\u3002<\/p>\n<p>\u305f\u3060\u3001\u3042\u304f\u307e\u3067\u3082if\u306e\u5bfe\u8c61\u306b\u306a\u308b\u306e\u306f\u5f8c\u306e1\u6587\u3060\u3051\u30022\u6587\u4ee5\u4e0a\u66f8\u304f\u306e\u306b\u306f\u3084\u3063\u3071\u308a{ }\u7701\u7565\u306f\u51fa\u6765\u306a\u3044\u3002<\/p>\n<p>\u3060\u304b\u3089\u610f\u5916\u3068\u9650\u3089\u308c\u305f\u72b6\u6cc1\u3067\u3057\u304b\u4f7f\u3048\u306a\u304f\u3066\u3001\u305d\u3046\u8003\u3048\u308b\u3068\u3001\u3055\u3063\u304d\u306e\u3088\u3046\u306a\u4f8b\u3067\u3082 { } \u3092\u66f8\u304f\u65b9\u304c\u7121\u96e3\u306a\u306e\u304b\u3082\u77e5\u308c\u306a\u3044\u3002<\/p>\n<hr \/>\n<p>\u521d\u5fc3\u8005\u5411\u3051\u306e\u8b1b\u5ea7\u306a\u306e\u3067\u3053\u3046\u3044\u3046\u90e8\u5206\u3067\u3082\u4e01\u5be7\u306b\u66f8\u3044\u3066\u304a\u3044\u305f\u65b9\u304c\u6b63\u3057\u3044\u7406\u89e3\u304c\u5f97\u3089\u308c\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u3002<\/p>\n<p>\u7279\u306b\u4eca\u56de\u306e\u3088\u3046\u306a\u306a\u306b\u3082\u3057\u306a\u3044\u30eb\u30fc\u30d7\u3092 for(\u2026); \u3063\u3066\u66f8\u304f\u306e\u306f\u6b63\u3057\u3044\u3051\u3069\u3069\u3046\u304b\u3068\u3082\u601d\u3046\u306e\u3088\u306d\u3002<\/p>\n<p>\u666e\u901a\u306f\u3053\u3093\u306a\u30eb\u30fc\u30d7\u4f5c\u3089\u3093\u304b\u3089\u3001\u4e00\u4f53\u306a\u306b\u3092\u3057\u3066\u308b\u306e\u304b\u306a\u3068\u601d\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n<p>\u305d\u308c\u306a\u3089 { } \u3068\u66f8\u3044\u3066\u304a\u3051\u3070\u3001\u306a\u306b\u3082\u3059\u308b\u3053\u3068\u304c\u306a\u3044\u3093\u3060\u306a\u3068\u660e\u5feb\u3060\u3002<\/p>\n<p>\u305c\u3072\u4eba\u306b\u8aac\u660e\u3059\u308b\u6642\u306f\u5236\u5fa1\u69cb\u9020\u306fPerl\u3067\u66f8\u3044\u3066\u3044\u308b\u3064\u3082\u308a\u3067 { } \u3092\u6b20\u304b\u3055\u306a\u3044\u3088\u3046\u306b\u5fc3\u304c\u3051\u3066\u3044\u3053\u3046\u3068\u304a\u3082\u3063\u305f\u3002<\/p>\n<hr \/>\n<p>\u3068\u3053\u308d\u3067C\u3067\u66f8\u304f\u3088\u3046\u306afor\u3063\u3066Perl\u3068\u304bRuby\u3067\u306f\u3042\u3093\u307e\u308a\u66f8\u304b\u3093\u3088\u306a\u3002<\/p>\n<pre>for my $i(1..$time){\n  for my $j(1..250){\n  }\n}<\/pre>\n<p>\u3068\u6570\u5024\u306b\u3064\u3044\u3066\u3084\u308b\u3068\u304d\u306f\u7bc4\u56f2\u6f14\u7b97\u5b50\u3092\u4f7f\u3046\u306e\u304c\u666e\u901a\u3002<\/p>\n<p>\u914d\u5217\u306b\u3064\u3044\u3066\u3084\u308b\u306a\u3089\u3001Perl\u30fbRuby\u3060\u3051\u3067\u306a\u304fC#\u3067\u3082foreach\u3092\u4f7f\u3048\u3070\u51fa\u6765\u308b\u3002<\/p>\n<p>\u305f\u3060\u3001C\u3067\u306fforeach\u306e\u3088\u3046\u306a\u6a5f\u80fd\u306f\u306a\u3044\u3002\u3060\u304b\u3089\u3053\u3046\u3084\u3063\u3066for(i=0;i&lt;time;i++) \u3068\u304b\u66f8\u304f\u308f\u3051\u3060\u3051\u3069\u3001<\/p>\n<p>\u3053\u3053\u3067i\u3068j\u304c\u51fa\u3066\u304f\u308b\u30681\u3064\u76ee\u306efor\u3067j\u304c\u51fa\u3066\u304d\u305f\u308a\u30012\u3064\u76ee\u306efor\u3067i\u304c\u51fa\u3066\u304d\u305f\u308a\u3068\u3044\u3046\u30df\u30b9\u3092\u3057\u3084\u3059\u3044\u3002<\/p>\n<p>\u610f\u56f3\u3057\u3066\u3084\u3063\u3066\u3044\u308b\u306a\u3089\u305d\u308c\u3067\u3082\u3044\u3044\u3093\u3060\u3051\u3069\u3001\u3053\u3093\u306a\u98a8\u306b\u6570\u5b57\u3092\u6570\u3048\u308b\u306e\u306a\u3089\u305d\u308c\u3067\u306f\u3044\u3051\u306a\u3044\u3002<\/p>\n<p>\u3069\u3046\u306b\u304b\u306a\u3089\u3093\u3082\u3093\u304b\u306d\u3068\u306f\u601d\u3046\u3051\u3069C\u3067\u306f\u3069\u3046\u306b\u3082\u306a\u3089\u3093\u8a71\u3002C++\u3067\u306f\u3069\u3046\u306a\u3093\u3060\u308d\u3002<\/p>\n<p><a href=\"http:\/\/www.boost.org\/doc\/libs\/1_46_1\/libs\/iterator\/doc\/counting_iterator.html\">boost::counting_iterator<\/a> \u3068\u304b\u304b\u306a\u3041\u3002\u3051\u3069algorithm\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3050\u3089\u3044\u3057\u304b\u4f7f\u3044\u9053\u306a\u3044\u3088\u306a\u3002<\/p>\n<p>\u4eca\u306e\u3068\u3053\u308d\u306f\u6ce8\u610f\u3057\u3066\u66f8\u304f\u3057\u304b\u306a\u3044\u3063\u3066\u3053\u3068\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u3082\u7d44\u307f\u8fbc\u307f\u306e\u8b1b\u5ea7\u3078\u3002 \u4eca\u65e5\u304b\u3089\u30de\u30a4\u30b3\u30f3\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u30c7\u30a3\u30b8\u30bf\u30eb\u5165\u51fa\u529b\u306b\u3064\u3044\u3066\u4e00\u901a\u308a\u3002 \u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u5206\u3067\u3044\u3058\u3044\u3058\u3057\u3066\u904a\u3093\u3067\u308b\u4eba\u3082\u3044\u305f\u304c\u3001\u307e\u305a\u306f\u30b5\u30f3\u30d7\u30eb\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5199\u3059\u3068\u3053\u308d\u304b\u3089\u306f\u3058\u307e\u308b\u3002 \u305f\u3060\u3001\u305d\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2436","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/2436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2436"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/2436\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}