{"id":107,"date":"2015-12-10T10:18:12","date_gmt":"2015-12-10T01:18:12","guid":{"rendered":"http:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/?page_id=107"},"modified":"2015-12-10T10:18:12","modified_gmt":"2015-12-10T01:18:12","slug":"c%e8%a8%80%e8%aa%9e%e8%ac%9b%e5%ba%a7%e3%80%80%e7%ac%ac%ef%bc%93%e5%9b%9e","status":"publish","type":"page","link":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/?page_id=107","title":{"rendered":"C\u8a00\u8a9e\u8b1b\u5ea7\u3000\u7b2c\uff13\u56de"},"content":{"rendered":"<h2\u6587\u5b57\u5217<\/h2>\n<p>\u7b2c\uff12\u56de\u3067\u306f\u3001\u6587\u5b57\u5217\u306e\u5ba3\u8a00\u3068\u51fa\u529b\u65b9\u6cd5\u306e\u8a71\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u3001\u3082\u3046\u5c11\u3057\u8a73\u3057\u304f\u6587\u5b57\u5217\u306e\u6271\u3044\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u4eca\u56de\u306f\u30dd\u30a4\u30f3\u30bf\u306e\u8a71\u3082\u51fa\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u6b21\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001\uff12\uff10\u7a2e\u985e\u306e\u30a2\u30df\u30ce\u9178\u3092\uff11\u6587\u5b57\u8868\u8a18\u3067\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;stdio.h&gt;\r\n#include &lt;string.h&gt;\r\n\r\nint main()\r\n{\r\n   int   i;    \/* i: loop counter *\/\r\n   char  one&#x5B;] = &quot;ACDEFGHIKLMNPQRSTVWY&quot;;\r\n\r\n   for (i = 0; i &lt; strlen( one ); i++) {\r\n       printf(&quot;%c &quot;, one&#x5B;i]);\r\n   }\r\n   printf(&quot;\\n&quot;);\r\n   return 0;\r\n}\r\n<\/pre>\n<p>amino1.c\u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3066\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\uff08\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\u306famino1\uff09\u3002<\/p>\n<pre>\r\n $ cc -o amino1 amino1.c\r\n $ .\/amino1\r\n<\/pre>\n<p>\u7d50\u679c\u306f\u3001<\/p>\n<pre>\r\n A C D E F G H I K L M N P Q R S T V W Y\r\n<\/pre>\n<p>\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\uff11\u884c\u76ee\u304a\u3088\u3073\uff13\u301c\uff15\u884c\u76ee\u307e\u3067\u306f\u3001\u3053\u308c\u307e\u3067\u3068\u540c\u3058\u3067\u3059\u304c\u3001\uff12\u884c\u76ee\u306b\u65b0\u3057\u3044\u5206\u304c\u4ed8\u3051\u52a0\u308f\u308a\u307e\u3057\u305f\u3002\u3053\u306e\uff12\u884c\u76ee\u306f\uff19\u884c\u76ee\u3067\u7528\u3044\u3089\u308c\u3066\u3044\u308bstrlen()\u95a2\u6570\u306e\u5b9a\u7fa9\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u201cstring.h\u201d\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306e\u884c\u3067\u3059\u3002\u3053\u306e\u884c\u304c\u306a\u3044\u3068\u3001strlen()\u95a2\u6570\u304c\u6b63\u3057\u304f\u50cd\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\uff16\u884c\u76ee\u3067\u306fint\u578b\u306e\u5909\u6570\u201ci\u201d\u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u5f8c\u306b\u3042\u308b\/* *\/\u3067\u56f2\u307e\u308c\u305f\u90e8\u5206\u306f\u30b3\u30e1\u30f3\u30c8\u6587\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5185\u5bb9\u306b\u306f\u76f4\u63a5\u306f\u95a2\u308f\u308a\u307e\u305b\u3093\u3002Python\u306e\u6642\u306e\u3088\u3046\u306b\u3001\u5909\u6570\u306e\u610f\u5473\u306a\u3069\u306e\u6ce8\u91c8\u3092\u3064\u3051\u3066\u304a\u304f\u6642\u306b\u3088\u304f\u7528\u3044\u3089\u308c\u307e\u3059\u3002\u306a\u304a\u3001\uff23\u8a00\u8a9e\u306e\u30b3\u30e1\u30f3\u30c8\u6587\u306f\u5165\u308c\u5b50\u69cb\u9020\uff08\u30b3\u30e1\u30f3\u30c8\u6587\u306e\u4e2d\u306b\u30b3\u30e1\u30f3\u30c8\u6587\u304c\u3042\u308b\u72b6\u614b\u3001\u3064\u307e\u308a\u3001\u201c\/* comment 1 \/* comment 2 *\/ *\/\u201d\u306e\u3088\u3046\u306a\u5f62\uff09\u306b\u306f\u3067\u304d\u306a\u3044\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u8a71\u3092\u623b\u3057\u3066\u3001\u201ci\u201d\u306f\u30b3\u30e1\u30f3\u30c8\u6587\u306b\u3082\u3042\u308b\u3088\u3046\u306b\u7e70\u308a\u8fd4\u3057\u3092\u6570\u3048\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\uff17\u884c\u76ee\u306f\u3001\u7b2c\uff12\u56de\u3067\u3082\u51fa\u3066\u304d\u305f\u3001\u6587\u5b57\u5217\u306e\u5ba3\u8a00\u304a\u3088\u3073\u521d\u671f\u5316\u306e\u305f\u3081\u306e\u884c\u3067\u3059\u3002char\u578b\u306e\u914d\u5217\u5909\u6570one\u3092\u5ba3\u8a00\u3057\u3066\u304a\u308a\u3001\u3053\u306e\u5909\u6570\u3092\u30a2\u30df\u30ce\u9178\u306e\uff11\u6587\u5b57\u8868\u8a18\u3067\u521d\u671f\u5316\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u884c\u306b\u304a\u3044\u3066one[0]\u306b'A'\u3001one[1]\u306b'C'\u3001...one[19]\u306b'Y'\u304c\u4ee3\u5165\u3055\u308c\u305f\u201cone\u201d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u4f5c\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\uff19\u301c\uff11\uff11\u884c\u76ee\u306f\u3001\u914d\u5217\u5909\u6570one\u3092\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002C\u8a00\u8a9e\u306b\u304a\u3051\u308bfor\u6587\u306f\u3001Python\u3067\u306e\u4f7f\u3044\u65b9\u3068\u5c11\u3057\u7570\u306a\u308a\u3001for (\u5f0fA;\u5f0fB;\u5f0fC) {\u547d\u4ee4}\u3068\u3044\u3046\u5f62\u3067\u4f7f\u308f\u308c\u307e\u3059\u3002for\u6587\u306b\u5230\u9054\u3059\u308b\u3068\u3001\u307e\u305a\u5f0fA\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u6b21\u306b\u3001\u5f0fB\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002\u3082\u3057\u5f0fB\u304c\u6210\u7acb\u3057\u3066\u3044\u308c\u3070\u3001\u201c{\u547d\u4ee4}\u201d\u306e\u90e8\u5206\u3092\u5b9f\u884c\u5f8c\u3001\u5f0fC\u3092\u5b9f\u884c\u3057\u3066\u3082\u3046\u4e00\u5ea6\u5f0fB\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002\u5f0fB\u304c\u6210\u7acb\u3057\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u306b\u306ffor\u6587\u304c\u7d42\u4e86\u3057\u307e\u3059\u3002\uff18\u301c\uff11\uff10\u884c\u76ee\u3092\u8aad\u307f\u4e0b\u3059\u3068\u3001\u307e\u305a\u5909\u6570i\u306b0\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002\u6b21\u306b\u3001i < strlen( one )\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002strlen()\u95a2\u6570\u306f\u3001char\u578b\u306e\u914d\u5217\u5909\u6570\u3092\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u3068\u3001\u305d\u306e\u914d\u5217\u5909\u6570\u306b\u5165\u3063\u3066\u3044\u308b\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u306f\u914d\u5217\u5909\u6570one\u304c20\u500b\u306e\u6587\u5b57\u304b\u3089\u3067\u304d\u3066\u3044\u308b\u306e\u3067\u300120\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002i\u306e\u4e2d\u8eab\u304c0\u306a\u306e\u3067\u5f0f\u304c\u6210\u7acb\u3057\u3001\uff19\u884c\u76ee\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001i\u756a\u76ee\u306e\u6587\u5b57\u5217one\u306e\u4e2d\u8eab\u306e\u8868\u793a\u3001\u3064\u307e\u308aone[0]\u3067\u6307\u5b9a\u3055\u308c\u308b\u5909\u6570\u306e\u4e2d\u8eab\uff08\u3053\u306e\u5834\u5408\u306f'A'\uff09\u306e\u8868\u793a\u3067\u3059\u3002\u6b21\u306bi++\uff08i\u306b1\u3092\u8db3\u3059\uff09\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u307e\u305fi < strlen(one)\u3092\u8a55\u4fa1\u3057...\u3068\u7d9a\u304d\u307e\u3059\u3002\u7d50\u5c40\u5909\u6570i\u306f0\u304b\u308919\u307e\u3067\u5909\u5316\u3059\u308b\u306e\u3067\u3001one[0], one[1], ..., one[19]\u306e\u9806\u756a\u306b\u6587\u5b57\u304c\u51fa\u529b\u3001\u3064\u307e\u308a\u3001'A', 'C', ...'Y'\u304c\u51fa\u529b\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\n\n\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3044\u3066\uff17\u884c\u76ee\u3092\u3001\n\n[c light=\"true\"]\nchar  *one = &quot;ACDEFGHIKLMNPQRSTVWY&quot;;\n[\/c]\n\n\u3068\u8a18\u8ff0\u3057\u3066\u3082\u307b\u307c\u540c\u3058\u7d50\u679c\u306b\u306a\u308a\u307e\u3059\u3002one\u306e\u524d\u306e\"*\"\u304c\u30dd\u30a4\u30f3\u30bf\u3092\u793a\u3059\u8a18\u53f7\u3067\u3059\u3002\u914d\u5217\u306b\u3088\u308b\u6587\u5b57\u5217\u306e\u5ba3\u8a00\uff0b\u521d\u671f\u5316\u3068\u30dd\u30a4\u30f3\u30bf\u306b\u3088\u308b\u6587\u5b57\u5217\u306e\u5ba3\u8a00\uff0b\u521d\u671f\u5316\u306b\u306f\u7d30\u304b\u3044\u9055\u3044\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u73fe\u6642\u70b9\u3067\u306f\u540c\u3058\u3053\u3068\u3060\u3068\u601d\u3063\u3066\u3082\u554f\u984c\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3068\u306b\u304b\u304f\u3001\u914d\u5217\u3067\u3082\u30dd\u30a4\u30f3\u30bf\u3067\u3082\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u304c\u8868\u73fe\u3067\u304d\u308b\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002\n\n\u6b21\u306f\u3001\uff12\uff10\u7a2e\u985e\u306e\u30a2\u30df\u30ce\u9178\u3092\uff13\u6587\u5b57\u8868\u8a18\u3067\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002\n\n[c]\n#include &lt;stdio.h&gt;\n\nint main()\n{\n   int   i;    \/* i: loop counter *\/\n   char  three[20][4] = { &quot;Ala&quot;, &quot;Cys&quot;, &quot;Asp&quot;, &quot;Glu&quot;, &quot;Phe&quot;,\n                          &quot;Gly&quot;, &quot;His&quot;, &quot;Ile&quot;, &quot;Lys&quot;, &quot;Leu&quot;,\n                          &quot;Met&quot;, &quot;Asn&quot;, &quot;Pro&quot;, &quot;Gln&quot;, &quot;Arg&quot;,\n                          &quot;Ser&quot;, &quot;Thr&quot;, &quot;Val&quot;, &quot;Trp&quot;, &quot;Tyr&quot; };\n\n   for (i = 0; i &lt; 20; i++) {\n       printf(&quot;%s &quot;, three[i]);\n   }\n   printf(&quot;\\n&quot;);\n   return 0;\n}\n[\/c]\n\namino3.c\u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\u306famino3\u3068\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3057\u3087\u3046\u3002\u5b9f\u884c\u3059\u308b\u3068\u3001\n\n\n\n<pre>\r\n Ala Cys Asp Glu Phe Gly His Ile Lys Leu Met Asn Pro Gln Arg Ser Thr Val Trp Tyr\r\n<\/pre>\n<p>\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6d41\u308c\u306f\u3001\u6700\u521d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u540c\u3058\u3067\u3059\u3002\u5927\u304d\u306a\u9055\u3044\u306f\uff16\u301c\uff19\u884c\u76ee\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001\u30a2\u30df\u30ce\u9178\u914d\u5217\u306e\uff13\u6587\u5b57\u8868\u8a18\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u3001\uff13\u3064\u306e\u6587\u5b57\u304b\u3089\u306a\u308b\u6587\u5b57\u5217\u3092\uff12\uff10\u500b\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u4f7f\u308f\u308c\u308b\u306e\u304c\uff12\u6b21\u5143\u914d\u5217\u3067\u3059\u3002<\/p>\n<p>\uff16\u301c\uff19\u884c\u76ee\u306f\u3001char\u578b\u306e\u914d\u5217\u5909\u6570three\u3092\u5ba3\u8a00\u3057\u3066\u304a\u308a\u3001\u3053\u306e\u5909\u6570\u3092\u30a2\u30df\u30ce\u9178\u306e\uff13\u6587\u5b57\u8868\u8a18\u3067\u521d\u671f\u5316\u3057\u3066\u3044\u307e\u3059\u3002\u201cchar three[20][4] =\u201d\u3068\u3044\u3046\u90e8\u5206\u306f\u3001\uff14\u3064\u306e\u6587\u5b57\u3092\u5165\u308c\u3089\u308c\u308b\u6587\u5b57\u5217\u304c20\u500b\u3067\u304d\u308b\u3088\u3046\u306bchar\u578b\u306e\uff12\u6b21\u5143\u914d\u5217\u5909\u6570\u3092\u5ba3\u8a00\u3057\u3001\u305d\u308c\u3092\u201c=\u201d\u4ee5\u4e0b\u306e\u6587\u5b57\u5217\u3067\u521d\u671f\u5316\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002\u8907\u6570\u306e\u6587\u5b57\u5217\u3067\u521d\u671f\u5316\u3059\u308b\u5834\u5408\u306f\u3001\"\"\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u5217\u3092\u201c,\u201d\u3067\u533a\u5207\u308a\u3001\u305d\u308c\u3092\u201c{\u3000}\u201d\u3067\u56f2\u3044\u307e\u3059\u3002<\/p>\n<p>\uff13\u6587\u5b57\u5206\u3057\u304b\u4ee3\u5165\u3057\u306a\u3044\u306e\u306b\u306a\u305c\uff14\u6587\u5b57\u5206\u306e\u914d\u5217\u3092\u7528\u610f\u3059\u308b\u304b\u7591\u554f\u306b\u601d\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u7b2c\uff12\u56de\u3067\u3082\u51fa\u3066\u304d\u305f\u3088\u3046\u306b\u3001\u6587\u5b57\u5217\u306e\u6700\u5f8c\u306b\u306f\u5fc5\u305a\"\\0\"\u3092\u3064\u3051\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u305f\u3081\u3067\u3059\u3002\u521d\u671f\u5316\u3059\u308b\u547d\u4ee4\u6587\u3067\u306f\u7279\u306b\u660e\u8a18\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u308b\u6642\u306b\uff14\u6587\u5b57\u76ee\u306b\"\\0\"\u304c\u4ed8\u3051\u52a0\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\uff11\uff11\u301c\uff11\uff13\u884c\u76ee\u3067\u306f\u3001\u914d\u5217\u5909\u6570three\u306e\u4e2d\u8eab\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u7b2c\uff12\u56de\u3067\u3001\u6587\u5b57\u5217\u3092\u51fa\u529b\u3059\u308b\u6642\u306fprintf()\u95a2\u6570\u306b\u304a\u3044\u3066\"%s\"\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002\uff12\u6b21\u5143\u914d\u5217\u306e\u5834\u5408\u306f\u3001\uff11\u6b21\u5143\u76ee\u3060\u3051\uff08three[0], three[1], ..., three[19]\uff09\u3092\u6307\u5b9a\u3057\u3066\"%s\"\u3092\u4f7f\u3046\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u6587\u5b57\u5217\uff08\"Ala\", \"Cys\", ...\"Tyr\"\uff09\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\uff16\u301c\uff19\u884c\u76ee\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3082\u307b\u307c\u540c\u3058\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: cpp; light: true; title: ; notranslate\" title=\"\">\r\n   char  *three&#x5B;] = { &quot;Ala&quot;, &quot;Cys&quot;, &quot;Asp&quot;, &quot;Glu&quot;, &quot;Phe&quot;,\r\n                      &quot;Gly&quot;, &quot;His&quot;, &quot;Ile&quot;, &quot;Lys&quot;, &quot;Leu&quot;,\r\n                      &quot;Met&quot;, &quot;Asn&quot;, &quot;Pro&quot;, &quot;Gln&quot;, &quot;Arg&quot;,\r\n                      &quot;Ser&quot;, &quot;Thr&quot;, &quot;Val&quot;, &quot;Trp&quot;, &quot;Tyr&quot; };\r\n<\/pre>\n<p>\u3053\u308c\u306f\u3001\u6587\u5b57\u5217\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u306e\u914d\u5217\u3092\u5ba3\u8a00\u3057\u3001\u305d\u306e\u4e2d\u8eab\u3092\u201c=\u201d\u4ee5\u4e0b\u3067\u521d\u671f\u5316\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002\u914d\u5217\u306e\u5927\u304d\u3055\u306f\u300120\u500b\u306e\u6587\u5b57\u5217\u3067\u521d\u671f\u5316\u3057\u3066\u3044\u308b\u306e\u3067\u81ea\u52d5\u7684\u306b20\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3082\u3001\u3053\u3046\u3044\u3046\u66f8\u304d\u65b9\u304c\u3042\u308b\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001\u30a2\u30df\u30ce\u9178\u306e\uff13\u6587\u5b57\u8868\u8a18\u306b\u5bfe\u5fdc\u3059\u308b\uff11\u6587\u5b57\u8868\u8a18\u3092\u899a\u3048\u308b\u305f\u3081\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3084\u308b\u3053\u3068\u306f\u3001<\/p>\n<ol>\n<li>20\u7a2e\u985e\u306e\u30a2\u30df\u30ce\u9178\u306e\uff13\u6587\u5b57\u8868\u8a18\u304a\u3088\u3073\uff11\u6587\u5b57\u8868\u8a18\u304c\u5165\u3063\u305f\u914d\u5217\u3092\u7528\u610f\u3059\u308b\u3002<\/li>\n<li>3\u6587\u5b57\u8868\u8a18\u3067\u30a2\u30df\u30ce\u9178\u3092\u51fa\u529b\u3059\u308b\u3002<\/li>\n<li>\u30ad\u30fc\u30dc\u30fc\u30c9\u3067\u5165\u529b\u3055\u308c\u305f\uff11\u6587\u5b57\u8868\u8a18\u306e\u30a2\u30df\u30ce\u9178\u3092\u8aad\u307f\u53d6\u308b\u3002<\/li>\n<li>\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u5217\u304c\u6b63\u3057\u3044\uff11\u6587\u5b57\u8868\u8a18\u304b\u3092\u8abf\u3079\u3001\u6b63\u3057\u3051\u308c\u3070\u300c\u6b63\u89e3\u300d\u3001\u9593\u9055\u3063\u3066\u3044\u308c\u3070\u6b63\u3057\u3044\uff11\u6587\u5b57\u8868\u8a18\u3092\u51fa\u529b\u3059\u308b\u3002<\/li>\n<li>2.\u304b\u30894.\u3092\u3059\u3079\u3066\u306e\u7a2e\u985e\u306e\u30a2\u30df\u30ce\u9178\u5206\u7e70\u308a\u8fd4\u3059\u3002<\/li>\n<\/ol>\n<p>\u4e0a\u8a18\u306e\u65b9\u91dd\u306b\u5f93\u3063\u3066\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u793a\u3057\u307e\u3059\u3002\u5165\u529b\u3057\u3066\u3001three2one.c\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4fdd\u5b58\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;stdio.h&gt;\r\n  \r\n#define MAXCHR      8\r\n  \r\nint main()\r\n{\r\n    int    i;\r\n    char   input&#x5B;MAXCHR];\r\n    char  *three&#x5B;] = { &quot;ALA&quot;, &quot;CYS&quot;, &quot;ASP&quot;, &quot;GLU&quot;, &quot;PHE&quot;,\r\n                       &quot;GLY&quot;, &quot;HIS&quot;, &quot;ILE&quot;, &quot;LYS&quot;, &quot;LEU&quot;,\r\n                       &quot;MET&quot;, &quot;ASN&quot;, &quot;PRO&quot;, &quot;GLN&quot;, &quot;ARG&quot;,\r\n                       &quot;SER&quot;, &quot;THR&quot;, &quot;VAL&quot;, &quot;TRP&quot;, &quot;TYR&quot; };\r\n    char  *one = &quot;ACDEFGHIKLMNPQRSTVWY&quot;;\r\n  \r\n    for (i = 0; i &lt; 20; i++) {\r\n        printf(&quot;3-letter code : %s\\n&quot;, three&#x5B;i]);\r\n        printf(&quot;1-letter code ? &quot;);\r\n        fgets(input, MAXCHR, stdin);\r\n     \r\n        if (input&#x5B;0] == one&#x5B;i]) {\r\n            printf(&quot;right!\\n&quot;);\r\n        } else {\r\n            printf(&quot;wrong! %c\\n&quot;, one&#x5B;i]);\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u3092\u8a18\u9332\u3059\u308b\u305f\u3081\u306b\u65b0\u3057\u3044\u547d\u4ee4\u304c\uff12\u3064\u5897\u3048\u3066\u3044\u307e\u3059\uff08\uff13\u884c\u76ee\u3001\uff11\uff18\u884c\u76ee\uff09\u3002<\/p>\n<p>\u307e\u305a\uff13\u884c\u76ee\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u306b\u5b58\u5728\u3059\u308b\u201cMAXCHR\u201d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u3059\u3079\u3066\u6570\u5b57\u306e\u201c8\u201d\u306b\u7f6e\u304d\u63db\u3048\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002#define\u547d\u4ee4\u306b\u3088\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u306b\u4f55\u5ea6\u3082\u51fa\u3066\u304f\u308b\u6570\u5b57\u306a\u3069\u3092\u4e00\u5ea6\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u547d\u4ee4\u3092\u3046\u307e\u304f\u4f7f\u3046\u3053\u3068\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5909\u66f4\u306b\u4f34\u3046\u6570\u5024\u306e\u4fee\u6b63\u306e\u3057\u5fd8\u308c\u306a\u3069\u304c\u5c11\u306a\u304f\u306a\u308b\u306f\u305a\u3067\u3059\u3002#define\u306e\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306f\uff23\u306e\u6587\u6cd5\u66f8\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\uff11\uff18\u884c\u76ee\u306f\u3001\u6a19\u6e96\u5165\u529b\u304b\u3089\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u3092\u201cMAXCHR\u201d\u3060\u3051\u6587\u5b57\u5217\u201cinput[]\u201d\u306b\u683c\u7d0d\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002\u201cMAXCHR\u201d\u306f#define\u547d\u4ee4\u306b\u3088\u308a\u201c8\u201d\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u5b9f\u969b\u306f\u6a19\u6e96\u5165\u529b\u304b\u3089\u306e\uff18\u6587\u5b57\u3092\u6587\u5b57\u5217\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002\u306a\u304a\u3001\u6a19\u6e96\u5165\u529b\u3068\u306f\u30ad\u30fc\u30dc\u30fc\u30c9\u306b\u3088\u308b\u5165\u529b\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3088\u308b\u5165\u529b\u3092\u6307\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u306e\u65b0\u3057\u3044\u70b9\u306f\u3001\uff12\uff10\u884c\u76ee\u306b\u3042\u308bif\u6587\u3067\u3059\u3002\u3053\u306eif\u6587\u306fPython\u306e\u5834\u5408\u3068\u540c\u3058\u69d8\u306a\u4f7f\u3044\u65b9\u3092\u3057\u307e\u3059\u3002\u304a\u3055\u3089\u3044\u3059\u308b\u3068\u3001if\u6587\u306f\u3000if ( \u5224\u5b9a\u5f0f \uff09{ \u547d\u4ee4\uff11 } else { \u547d\u4ee4\uff12 }\u3000\u3068\u3044\u3046\u5f62\u3067\u4f7f\u3044\u3001\u5224\u5b9a\u5f0f\u304c\u6210\u308a\u7acb\u3066\u3070\u547d\u4ee4\uff11\u3001\u6210\u308a\u7acb\u305f\u306a\u3051\u308c\u3070\u547d\u4ee4\uff12\u3092\u5b9f\u884c\u3057\u307e\u3059\uff08else\u4ee5\u964d\u306f\u7701\u7565\u53ef\u80fd\uff09\u3002\u3082\u3057\u5224\u5b9a\u5f0f\u304c\uff12\u3064\u4ee5\u4e0a\u3042\u308c\u3070\u3001\u3000if ( \u5224\u5b9a\u5f0f\uff11 \uff09{ \u547d\u4ee4\uff11 } else if ( \u5224\u5b9a\u5f0f\uff12 ) { \u547d\u4ee4\uff12 } else { \u547d\u4ee4\uff13 }\u3000\u3068\u3044\u3046\u5f62\u306b\u306a\u308a\u307e\u3059\u3002\u8907\u6570\u306e\u5224\u5b9a\u5f0f\u304c\u3042\u308b\u5834\u5408\u306b\u3001Python\u3067\u306f\u201celif\u201d\u3067\u3064\u306a\u304e\u307e\u3059\u304c\u3001\uff23\u8a00\u8a9e\u3067\u306f\u201celse if\u201d\u3067\u3064\u306a\u304e\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u5224\u5b9a\u5f0f\u306b\u304a\u3044\u3066\uff12\u3064\u306e\u5909\u6570\u306e\u4e2d\u8eab\u304c\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u201c==\u201d\uff08=\u304c\uff12\u3064\u91cd\u306a\u308b\uff09\u3001\u7570\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u201c!=\u201d\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002\uff23\u8a00\u8a9e\u3067\u306f\u914d\u5217\u540c\u58eb\u3092\u6bd4\u8f03\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001\u5fc5\u305a\u5909\u6570\u540c\u58eb\u306e\u6bd4\u8f03\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u30a2\u30df\u30ce\u9178\u306e\uff13\u6587\u5b57\u8868\u8a18\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u308b\u9806\u756a\u3068\uff11\u6587\u5b57\u8868\u8a18\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u308b\u9806\u756a\u3092\u540c\u3058\u306b\u3059\u308b\u3068\u3053\u308d\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u51fa\u529b\u3057\u305f\uff13\u6587\u5b57\u8868\u8a18\u3068\u5165\u529b\u3059\u308b\uff11\u6587\u5b57\u8868\u8a18\u306e\u5bfe\u5fdc\u3092\u7c21\u5358\u306b\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u7df4\u7fd2\u554f\u984c<\/h2>\n<ol>\n<li>\u30d7\u30ed\u30b0\u30e9\u30e0three2one.c\u3092\u6539\u5909\u3057\u3001\u6b63\u3057\u3044\uff11\u6587\u5b57\u8868\u8a18\u3092\u5165\u529b\u3067\u304d\u305f\u6570\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u3057\u306a\u3055\u3044\u3002<\/li>\n<li>1.\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6539\u5909\u3057\u3001\u30a2\u30df\u30ce\u9178\u306e\uff11\u6587\u5b57\u8868\u8a18\u306b\u5bfe\u5fdc\u3059\u308b\uff13\u6587\u5b57\u8868\u8a18\u3092\u899a\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3057\u306a\u3055\u3044\u3002\u305f\u3060\u3057\u3001\u6587\u5b57\u5217\u306e\u6bd4\u8f03\u306b\u306f\u3001strncmp()\u95a2\u6570\u3092\u7528\u3044\u308b\uff08string.h\u3092include\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\uff09\u3002strncmp()\u95a2\u6570\u306f\uff12\u3064\u306e\u6587\u5b57\u5217\u3092\u6bd4\u8f03\u3057\u3001\u7b49\u3057\u3051\u308c\u30700\u3001\u7b49\u3057\u304f\u306a\u3051\u308c\u30700\u4ee5\u5916\u306e\u5024\u3092\u8fd4\u3059\u3002\u5177\u4f53\u7684\u306a\u4f7f\u3044\u65b9\u306f\u3001\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n if (strncmp(three&#x5B;i], input, 3) == 0) {\r\n     printf(&quot;right\\n&quot;);\r\n } else {\r\n     printf(&quot;wrong! %s\\n&quot;, three&#x5B;i]);\r\n }\r\n<\/pre>\n<p>\u3068\u306a\u308b\u3002<\/li>\n<li>\u30b3\u30c9\u30f3\uff13\u5869\u57fa\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u30a2\u30df\u30ce\u9178\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u306a\u3055\u3044\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":96,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","vkExUnit_sitemap":"","_veu_custom_css":"","veu_display_promotion_alert":"","_exclude_from_list_pages":"","vkexunit_cta_each_option":"","vkExUnit_childPageIndex":"","vkExUnit_pageList_ancestor":"","vkExUnit_contact_enable":"","_lightning_design_setting":[],"footnotes":""},"class_list":["post-107","page","type-page","status-publish","hentry"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/pages\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":1,"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/pages\/107\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/pages\/107\/revisions\/108"}],"up":[{"embeddable":true,"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=\/wp\/v2\/pages\/96"}],"wp:attachment":[{"href":"https:\/\/b-lab.nagahama-i-bio.ac.jp\/~m_shionyu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}