{"id":1427,"date":"2008-10-08T23:08:00","date_gmt":"2008-10-08T14:08:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=148"},"modified":"2008-10-08T23:08:00","modified_gmt":"2008-10-08T14:08:00","slug":"blogn-148","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=148","title":{"rendered":"\u6614\u61d0\u304b\u3057\u306egoto\u306e\u3088\u3046\u306a\u3082\u306e"},"content":{"rendered":"<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b8c\u6210!! \u75b2\u308c\u305f\u30fc\u3002<br \/>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5370\u5237\u3068\u304b\u4f55\u3060\u3088\u3002\u5927\u5909\u3059\u304e\u308b\u3002<br \/>\u3055\u3066\u3001\u3068\u3053\u308d\u3067\u3053\u3046\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u66f8\u304d\u65b9\u304c\u7d50\u69cb\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u3044\u3002<\/p>\n<pre>val=a>b?a:b;<\/pre>\n<p>\u3053\u306e\uff5e?\uff5e:\uff5e\u3068\u3044\u3046\u6f14\u7b97\u5b50\u3092\u4e09\u9805\u6f14\u7b97\u5b50\u3068\u307e\u3041\u305d\u3046\u3044\u3046\u308f\u3051\u3067\u3059\u306d\u3002<br \/>\u305f\u3057\u304b\u306b\u4e09\u9805\u306a\u3093\u3060\u304c\u3001\u4ed6\u306b\u4e09\u9805\u306e\u6f14\u7b97\u5b50\u3063\u3066\u306a\u3044\u306e\u304b?<br \/>\u3053\u308c\u306f\u3001a>b\u304ctrue\u306a\u3089a\u3092false\u306a\u3089b\u3092\u8fd4\u3059\u3068\u3044\u3046\u6f14\u7b97\u5b50\u3002\u306a\u306e\u3067\u3053\u3046\u3044\u3046\u98a8\u306b\u66f8\u3044\u3066\u3082\u4e00\u7dd2\u3002<\/p>\n<pre>if(a>b)  val=a;<br \/>else     val=b;<\/pre>\n<p>\u307e\u3041\u3053\u3061\u3089\u306e\u65b9\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u306e\u306f\u78ba\u304b\u3067\u3059\u3051\u3069\u306d\u3002<br \/>\u3057\u304b\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u3068\u304b\u306b\u4f7f\u3046\u3068\u3001\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u66f8\u3051\u305f\u308a\u3068\u3044\u3046\u306e\u306f\u3042\u308b\u304b\u3082\u3057\u308c\u3093\u3002<br \/>\u305f\u3060\u3042\u3093\u307e\u308a\u4f7f\u3044\u9053\u306f\u591a\u304f\u306a\u3044\u6c17\u304c\u3059\u308b\u3002<br \/>\u4ee5\u524d\u767a\u898b\u3057\u305f\u3001Perl\u3067\u306e\/\/\u6f14\u7b97\u5b50\u3001C#\u3067\u306e??\u6f14\u7b97\u5b50\u3002<br \/>\u3053\u308c\u306f$a\/\/$b\u306a\u3089$a\u304cundef(\u672a\u5b9a\u7fa9)\u3067\u306a\u3051\u308c\u3070$a\u3001undef\u306a\u3089\u3070$b\u3092\u8fd4\u3059\u3068\u3044\u3046\u6f14\u7b97\u5b50\u3067\u3059\u306d\u3002<br \/>\u3053\u308c\u3082if\u3067\u66f8\u3051\u3070\u3044\u3044\u3093\u3060\u304c\u3001\u4f55\u304b\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3068\u3002<\/p>\n<hr \/>\n<p>\u3055\u3066\u3001C#\u306b\u3057\u3066\u3082C\u306b\u3057\u3066\u3082\u3001\u8fd4\u308a\u5024\u306a\u3057\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3044\u3046\u306e\u306f\u7d50\u69cb\u3042\u308b\u3002<br \/>\u5b9f\u306f\u305d\u306e\u4e2d\u3067return\u6587\u4f7f\u3048\u308b\u3093\u3067\u3059\u306d\u3002<br \/>\u4f55\u3067\u305d\u3093\u306a\u3082\u306e\u3044\u308b\u3093\u3060\u3068\u3044\u3046\u306e\u306f\u3042\u308b\u306e\u3060\u304c\u3001\u3053\u3046\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre>if(val<0)  return;<\/pre>\n<p>\u3053\u3046\u3044\u3046\u98a8\u306b\u66f8\u304f\u3068\u3001val<0\u306a\u3089\u3070\u305d\u3053\u3067\u30e1\u30bd\u30c3\u30c9\u7d42\u308f\u308a\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\u306a\u3093\u304b\u5909\u306a\u611f\u3058\u3067\u3059\u306d\u3002\u3051\u3069\u8fd4\u308a\u5024\u304c\u3042\u308b\u3082\u306e\u3060\u3068\u3069\u3046\u611f\u3058\u308b\u3060\u308d\u3046\u304b\u3002<\/p>\n<pre>public static int fact(int x){<br \/>  if(x<=1)  return 1;<br \/>  int r=fact(x-1);<br \/>  return x*r;<br \/>}<\/pre>\n<p>\u306a\u3093\u304belse\u4f7f\u3063\u3066\u306a\u304f\u3066\u5909\u306a\u611f\u3058\u306a\u3093\u3060\u304c\u3001\u3053\u308c\u306fx<=1\u306a\u30891\u3060\u3051\u8fd4\u3057\u3066\u7d42\u308f\u308c\u3070\u3088\u308d\u3057\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f\u3053\u3046\u3044\u3046\u51e6\u7406\u3092\u3057\u307e\u3059\u3068\u2026\u305d\u3046\u3044\u3046\u98a8\u306b\u66f8\u3051\u3070\u3088\u3044\u3068\u3002<br \/>\u308f\u304b\u308a\u3084\u3059\u3044\u3068\u601d\u3046\u4eba\u3082\u3044\u308c\u3070\u3001\u975e\u5e38\u306b\u308f\u304b\u308a\u306b\u304f\u3044\u3068\u601d\u3046\u4eba\u3082\u3044\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\u3068\u3044\u3046\u306e\u306f\u3001\u5b9f\u306f\u3053\u3046\u3044\u3046return\u306e\u4f7f\u3044\u65b9\u306f\u5f62\u3092\u5909\u3048\u305fgoto\u3060\u3068\u8a00\u308f\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3057\u3002<br \/>\u3060\u304b\u3089\u3001\u8fd4\u308a\u5024\u304c\u306a\u3044return\u306f\u3001\u6700\u5f8c\u306b\u3042\u308bend\u30e9\u30d9\u30eb\u306b\u98db\u3076\u3001goto end;\u3068\u4f55\u3089\u5909\u308f\u308a\u306a\u3044\u3068\u3002<br \/>\u307e\u3041\u78ba\u304b\u306b\u305d\u308c\u306f\u305d\u3046\u306a\u3093\u3067\u3059\u304c\u3001\u3053\u306e\u7a0b\u5ea6\u306a\u3089\u4f55\u306e\u554f\u984c\u306f\u306a\u3044\u3088\u3046\u306a\u6c17\u306f\u3057\u307e\u3059\u3002<br \/>\u3080\u3057\u308d\u3001\u3053\u308c\u3092if\uff5eelse\uff5e\u3067\u66f8\u304f\u3068\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u6df1\u304f\u306a\u3063\u3066\u56f0\u308b\u306e\u3088\u306d\u3002<\/p>\n<hr \/>\n<p>\u3053\u308c\u306f\u50d5\u306e\u60aa\u3044\u7656\u306e\u3088\u3046\u306a\u6c17\u306f\u3059\u308b\u306e\u3060\u304c\u3001\u3053\u3046\u3044\u3046\u306e\u304c\u7d50\u69cb\u591a\u3044\u3002<\/p>\n<pre>while(true){<br \/>  \/\/\u3044\u308d\u3044\u308d<br \/>  if(t<0)  break;<br \/>}<\/pre>\n<p>\u3053\u308c\u898b\u3066\u3001do\uff5ewhile\u4f7f\u3048\u3068\u601d\u3063\u305f\u4eba\u306f\u591a\u3044\u304b\u3082\u77e5\u308c\u3093\u3002<br \/>\u78ba\u304b\u306b\u3053\u308c\u51b7\u9759\u306b\u8003\u3048\u308c\u3070do\uff5ewhile\u4f7f\u3046\u65b9\u304c\u3044\u3044\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3051\u3069\u306d\u3002<br \/>\u305f\u3060\u3001do\uff5ewhile\u3063\u3066\u521d\u3081\u306bdo\u3068\u3057\u304b\u66f8\u3044\u3066\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3002\u3060\u304b\u3089\u308f\u304b\u308a\u306b\u304f\u3044\u3068\u3002<br \/>\u3067\u3001Perl\u306edo\u30d6\u30ed\u30c3\u30af\u3063\u3066\u3001\u52d5\u4f5c\u3092\u307e\u3068\u3081\u305f\u3060\u3051\u3067\u3001while\u4fee\u98fe\u5b50\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3082\u306e\u3068\u3044\u3046\u308f\u3051\u3067\u3082\u306a\u3044\u3002<br \/>\u3069\u3061\u3089\u304b\u3068\u3044\u3046\u3068\u3001\u3053\u3061\u3089\u306e\u65b9\u304c\u50d5\u306f\u7d0d\u5f97\u304c\u3044\u304f\u306e\u3067\u3001\u5168\u304fdo\uff5ewhile\u306f\u4f7f\u308f\u306a\u3044\u3002<br \/>\u3067\u3001\u305d\u3046\u3044\u3046\u3053\u3068\u306b\u3082\u7121\u9650\u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u3066\u3001\u5fc5\u8981\u306a\u3068\u3053\u308d\u3067break;\u3067\u51fa\u308b\u3068\u3002<br \/>\u307e\u3041break;\u306f\u3082\u3063\u3068\u6709\u76ca\u306b\u4f7f\u3048\u3068\u3044\u3046\u6307\u6458\u306f\u3054\u3082\u3063\u3068\u3082\u306a\u8a71\u3067\u3059\u304c\u306d\u3002<br \/>\u3042\u3068continue;\u3068\u3044\u3046\u306e\u3082\u3061\u3087\u3063\u3068\u5909\u306a\u611f\u3058\u3002<\/p>\n<pre>foreach(int cur in arr)[<br \/>  if(cur<0)  continue;<br \/>  \/\/\u3044\u308d\u3044\u308d<br \/>  if(cur==5) {  Console.WriteLine(\"Five!\"); continue; }<br \/>  if(cur==7) {  Console.WriteLine(\"Seven!\"); continue; }<br \/>  Console.WriteLine(\"{0}!\",cur); <br \/>}<\/pre>\n<p>continue\u306e\u4f7f\u3044\u9053\u306a\u3093\u3060\u304c\u3001\u4f8b\u3048\u3070\u3042\u308b\u6761\u4ef6\u306b\u5f53\u3066\u306f\u307e\u308b\u306e\u3092\u629c\u304d\u51fa\u3059\u3068\u304b\u8a00\u3046\u306e\u3067\u3001<br \/>\u5f53\u3066\u306f\u307e\u3089\u3093\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u305f\u3089\u3001continue;\u3068\u3059\u308c\u3070\u3001\u3082\u3046\u305d\u306e\u5206\u306e\u51e6\u7406\u306f\u7d42\u308f\u308b\u3068\u3002<br \/>for\u3068\u304bforeach\u3067\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u306d\u3002<br \/>\u3051\u3069\u3001\u7d50\u69cbswitch\u69cb\u6587\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u3046\u3053\u3068\u3082\u591a\u3044\u3093\u3060\u3088\u306d\u3002<br \/>\u6700\u5f8c\u306bcontinue;\u3092\u4ed8\u3051\u305fif\u3092\u305f\u304f\u3055\u3093\u4e26\u3079\u3066\u3001\u305d\u308c\u3067switch\u307f\u305f\u3044\u306b\u4f7f\u3046\u3068\u3002<br \/>switch\u69cb\u6587\u304c\u3042\u3093\u307e\u308a\u7d30\u304b\u3044\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u304b\u3089\u306a\u3093\u3067\u3059\u3051\u3069\u3001<br \/>\u307e\u3041\u3069\u3046\u306a\u3093\u3067\u3057\u3087\u3046\u306d\u3047\u3002<br \/>Perl 5.10\u306eforeach\uff5ewhen\u69cb\u6587\u304c\u3042\u308c\u3070\u3053\u3093\u306a\u3053\u3068\u3057\u306a\u304f\u3066\u3044\u3044\u306a\u3041\u3068\u601d\u3063\u3066\u308b\u3093\u3060\u3051\u3069\u306d\u3002<\/p>\n<hr \/>\n<p>return; break; continue; \u3069\u308c\u3082\u5f62\u3092\u5909\u3048\u305fgoto\u6587\u3068\u8a00\u3048\u3070\u307e\u3041\u305d\u3046\u306a\u3093\u3067\u3059\u3002<br \/>\u3051\u3069\u3069\u308c\u3082\u4f7f\u3044\u9053\u306f\u7d50\u69cb\u306f\u3063\u304d\u308a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\u3053\u308c\u3092\u4f7f\u3048\u3070goto\u6587\u306f\u3042\u307e\u308a\u5fc5\u8981\u306b\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\u591a\u3044\u610f\u898b\u3067\u3001\u3042\u3068\u306f\u591a\u91cd\u30eb\u30fc\u30d7\u304b\u3089\u306e\u8131\u51fa\u306bgoto\u3092\u4f7f\u3046\u3068\u304b\u3042\u308a\u307e\u3059\u3051\u3069\u306d\u3002<br \/>\u78ba\u304b\u306b\u308f\u304b\u3089\u3093\u3053\u3068\u306f\u306a\u3044\u3002\u3051\u3069\u305d\u3093\u306a\u306b\u6570\u306f\u591a\u304f\u306a\u3055\u305d\u3046\u306a\u306e\u3067\u3001goto\u306f\u307b\u3068\u3093\u3069\u4f7f\u308f\u306a\u3044\u3068\u8a00\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\u6614\u306eBASIC\u306f\u5168\u90e8GOTO\u3060\u3063\u305f\u3093\u3067\u3059\u3088\u3002\u3060\u3051\u3069\u3001\u4eca\u306f\u30d6\u30ed\u30c3\u30af\u4f5c\u3063\u3066\u3044\u308d\u3044\u308d\u3067\u304d\u307e\u3059\u3088\u306d\u3002<br \/>\u304b\u306a\u308a\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308b\u3082\u3093\u3067\u3059\u3002<br \/>\u3060\u304b\u3089\u3053\u3046\u3044\u3046\u98a8\u306bgoto\u3092\u4f7f\u3046\u3053\u3068\u3092\u6e1b\u3089\u3059\u7fd2\u6163\u3068\u3044\u3046\u306e\u306f\u308f\u304b\u308a\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306e\u8fd1\u9053\u304b\u306a\u3068\u3002<br \/>\u3057\u304b\u3057\u6e1b\u3089\u3059\u3093\u3067\u3042\u3063\u3066\u306a\u304f\u3059\u308f\u3051\u3067\u306f\u306a\u3044\u3067\u3059\u304b\u3089\u306d\u3002<br \/>\u305d\u3053\u306e\u3068\u3053\u308d\u306f\u9593\u9055\u3048\u3061\u3083\u3044\u304b\u3093\u3088\u3068\u3044\u3046\u306e\u306f\u3042\u308b\u308f\u306a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b8c\u6210!! \u75b2\u308c\u305f\u30fc\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5370\u5237\u3068\u304b\u4f55\u3060\u3088\u3002\u5927\u5909\u3059\u304e\u308b\u3002\u3055\u3066\u3001\u3068\u3053\u308d\u3067\u3053\u3046\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u66f8\u304d\u65b9\u304c\u7d50\u69cb\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u3044\u3002 val=a>b?a:b; \u3053\u306e\uff5e?\uff5e:\uff5e\u3068\u3044\u3046\u6f14\u7b97\u5b50\u3092\u4e09\u9805\u6f14\u7b97\u5b50\u3068\u307e\u3041\u305d\u3046\u3044 [&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-1427","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1427","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=1427"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1427\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}