{"id":1788,"date":"2019-12-23T18:19:13","date_gmt":"2019-12-23T09:19:13","guid":{"rendered":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/?page_id=1788"},"modified":"2025-12-24T17:17:20","modified_gmt":"2025-12-24T08:17:20","slug":"%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e","status":"publish","type":"page","link":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/","title":{"rendered":"\u8a08\u7b97\u6570\u5b66\u6f14\u7fd2\u7b2c\uff17\u56de"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u30b3\u30f3\u30c6\u30f3\u30c4<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69eb5d8d442c5\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69eb5d8d442c5\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e9%85%8d%e5%88%97\" >\u914d\u5217<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e4%bb%8a%e6%97%a5%e3%81%ae%e7%9b%ae%e6%a8%99\" >\u4eca\u65e5\u306e\u76ee\u6a19<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e9%85%8d%e5%88%97%e5%a4%89%e6%95%b0%e3%81%ae%e5%ae%a3%e8%a8%80%e3%81%a8%e5%88%a9%e7%94%a8\" >\u914d\u5217\u5909\u6570\u306e\u5ba3\u8a00\u3068\u5229\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e3%83%99%e3%82%af%e3%83%88%e3%83%ab%e3%81%ae%e8%a8%88%e7%ae%97%ef%bc%88%e5%86%85%e7%a9%8d%e3%81%ae%e8%a8%88%e7%ae%97%ef%bc%89\" >\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97\uff08\u5185\u7a4d\u306e\u8a08\u7b97\uff09<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%91\" >\u8ab2\u984c\uff11<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%91-2\" >\u8ab2\u984c\uff11&#8217;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%a4%87%e6%95%b0%e3%81%ae%e5%85%a5%e5%8a%9b%e5%80%a4%e3%81%ae%e6%9c%80%e5%a4%a7%e5%80%a4%ef%bc%88%e6%9c%80%e5%b0%8f%e5%80%a4%ef%bc%89%e3%82%92%e6%b1%82%e3%82%81%e3%82%8b\" >\u8907\u6570\u306e\u5165\u529b\u5024\u306e\u6700\u5927\u5024\uff08\u6700\u5c0f\u5024\uff09\u3092\u6c42\u3081\u308b<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%92\" >\u8ab2\u984c\uff12<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%93\" >\u8ab2\u984c\uff13<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e5%a4%9a%e6%ac%a1%e5%85%83%e9%85%8d%e5%88%97%e5%a4%89%e6%95%b0\" >\u591a\u6b21\u5143\u914d\u5217\u5909\u6570<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%94\" >\u8ab2\u984c\uff14<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%95\" >\u8ab2\u984c\uff15<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%96\" >\u8ab2\u984c\uff16<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%e8%aa%b2%e9%a1%8c%ef%bc%97\" >\u8ab2\u984c\uff17<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/#%ef%bc%88%e3%81%8a%e3%81%be%e3%81%91%ef%bc%89%e6%95%b0%e5%80%a4%e3%81%ae%e5%85%a5%e5%8a%9b%e5%9b%9e%e6%95%b0%e3%82%92%e3%82%ab%e3%82%a6%e3%83%b3%e3%83%88%e3%81%99%e3%82%8b\" >\uff08\u304a\u307e\u3051\uff09\u6570\u5024\u306e\u5165\u529b\u56de\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%e9%85%8d%e5%88%97\"><\/span>\u914d\u5217<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u6f14\u7fd2\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u914d\u5217\u5909\u6570<\/li>\n<li>\u914d\u5217\u3068\u7e70\u308a\u8fd4\u3057\u6587\u3092\u7528\u3044\u305f\u6f14\u7b97<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"%e4%bb%8a%e6%97%a5%e3%81%ae%e7%9b%ae%e6%a8%99\"><\/span>\u4eca\u65e5\u306e\u76ee\u6a19<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u914d\u5217\u3092\u7406\u89e3\u3059\u308b\u3002<br \/>\n\u7e70\u308a\u8fd4\u3057\u6587\u3084\u914d\u5217\u5909\u6570\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5229\u7528\u3059\u308b\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e9%85%8d%e5%88%97%e5%a4%89%e6%95%b0%e3%81%ae%e5%ae%a3%e8%a8%80%e3%81%a8%e5%88%a9%e7%94%a8\"><\/span>\u914d\u5217\u5909\u6570\u306e\u5ba3\u8a00\u3068\u5229\u7528<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>C\u8a00\u8a9e\u306b\u9650\u3089\u305a\u3001\u307b\u3068\u3093\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u306f\u914d\u5217\u5909\u6570\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u914d\u5217\u5909\u6570\u306f\u4f8b\u3048\u3070\u6b21\u306e\u3088\u3046\u306b\u5ba3\u8a00\u3059\u308b\u3053\u3068\u3067\u7528\u610f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\nint a[5];<br \/>\n\u3053\u308c\u306b\u3088\u308a\u3001\u6b21\u306e\u3088\u3046\u306b\u6574\u6570\u578b\u306e\u5909\u6570\u304c\uff15\u500b\u7528\u610f\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\na[0], a[1], a[2], a[3], a[4]<br \/>\n\u304b\u304e\u62ec\u5f27 [ ] \u3067\u56f2\u307e\u308c\u305f\u6570\u5b57\u306f<span style=\"color: #ff0000;\"><strong>\u6dfb\u5b57<\/strong><\/span>\u3068\u547c\u3070\u308c\u307e\u3059\u3002 \u3053\u306e\u3088\u3046\u306b\u6dfb\u5b57\u306f 0 \u304b\u3089\u59cb\u307e\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2017\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/uploads\/2020\/01\/array-768x309-1.png\" alt=\"\" width=\"768\" height=\"309\" srcset=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/uploads\/2020\/01\/array-768x309-1.png 768w, https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/uploads\/2020\/01\/array-768x309-1-300x121.png 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092 array-1.c \u3068\u3057\u3066\u6253\u3061\u8fbc\u3093\u3067\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\uff15\u500b\u306e\u6574\u6570\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u5165\u529b\u5024\u3092\u9006\u306e\u9806\u756a\u3067\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">array-1.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n    \/* \u6574\u6570\u578b\u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i, n, c[5];\r\n \r\n    \/* c[0] \uff5e c[4] \u306e\u5165\u529b *\/\r\n    for (i = 0; i &lt; 5; i++) {\r\n        printf(\"\u6574\u6570\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1ac[%d]= \", i);\r\n        scanf(\"%d\", &amp;c[i]);\r\n    }\r\n \r\n    \/* c[4] \uff5e c[0] \u306e\u51fa\u529b *\/\r\n    for (i = 0; i &lt; 5; i++) {\r\n        printf(\"c[%d]=%d\\n\", 4-i,c[4-i]);\r\n    }\r\n \r\n    return 0;\r\n}<\/pre>\n<p>\u6574\u6570\u578b\u306e\u914d\u5217\u4ee5\u5916\u306b\u3082\u5b9f\u6570\u578b\u306e\u914d\u5217\u3082\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001<span style=\"color: #ff0000;\"><strong>\u914d\u5217\u5909\u6570\u306e\u6dfb\u5b57\u306b\u306f\u6574\u6570\u578b\u306e\u5909\u6570<\/strong><\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\ndouble u[6];<br \/>\n\u3068\u5ba3\u8a00\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001<br \/>\nu[0], u[1], u[2], u[3], u[4], u[5]<br \/>\n\u3068\u3001\uff16\u3064\u306e\u5b9f\u6570\u578b\u5909\u6570\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e3%83%99%e3%82%af%e3%83%88%e3%83%ab%e3%81%ae%e8%a8%88%e7%ae%97%ef%bc%88%e5%86%85%e7%a9%8d%e3%81%ae%e8%a8%88%e7%ae%97%ef%bc%89\"><\/span>\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97\uff08\u5185\u7a4d\u306e\u8a08\u7b97\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4f8b\u3048\u3070\u914d\u5217\u5909\u6570 u[i] \u3092\u30d9\u30af\u30c8\u30eb <strong>u<\/strong> \u306e i \u6210\u5206\u3068\u307f\u306a\u3059\u3068\u3001\u3044\u304f\u3064\u304b\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u4e8c\u3064\u306e\uff13\u6b21\u5143\u30d9\u30af\u30c8\u30eb\u3000<strong>u<\/strong>, <strong>v<\/strong> \u306e\u5185\u7a4d\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0 (array-2.c) \u3067\u3059\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">array-2.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n    \/* \u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i;\r\n \r\n    \/*\uff08\u30d9\u30af\u30c8\u30eb\u306e\u5404\u6210\u5206\u306f\u914d\u5217\u3067\u5ba3\u8a00\uff09*\/\r\n    double u[3], v[3], naiseki;\r\n \r\n    \/* \u30d9\u30af\u30c8\u30eb\u306e\u5404\u6210\u5206 u[0] \uff5e u[2] \u306e\u5165\u529b *\/\r\n    for (i = 0; i &lt; 3; i++) {\r\n        printf(\"\u30d9\u30af\u30c8\u30eb u \u306e\u7b2c%d\u6210\u5206\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1a \", i);\r\n        scanf(\"%lf\", &amp;u[i]);\r\n    }\r\n \r\n    \/* \u30d9\u30af\u30c8\u30eb\u306e\u5404\u6210\u5206 v[0] \uff5e v[2] \u306e\u5165\u529b *\/\r\n    for (i = 0; i &lt; 3; i++) {\r\n        printf(\"\u30d9\u30af\u30c8\u30eb v \u306e\u7b2c%d\u6210\u5206\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1a \", i);\r\n        scanf(\"%lf\", &amp;v[i]);\r\n    }\r\n \r\n    \/* \u5185\u7a4d\u306e\u521d\u671f\u5316 *\/\r\n    naiseki = 0.0;\r\n \r\n    \/* \u5185\u7a4d\u306e\u8a08\u7b97 *\/\r\n    for (i = 0; i &lt; 3; i++) {\r\n        naiseki = naiseki + u[i]*v[i];\r\n    }\r\n \r\n    printf(\"\u5185\u7a4d=%lf\\n\", naiseki);\r\n \r\n    return 0;\r\n}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%91\"><\/span><u>\u8ab2\u984c\uff11<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>array-2.c \u3092\u3001\uff12\u3064\u306e\uff15\u6b21\u5143\u30d9\u30af\u30c8\u30eb\u306e\u5185\u7a4d\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u6539\u9020\u305b\u3088\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%91-2\"><\/span><u>\u8ab2\u984c\uff11&#8217;<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>array-2.c \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6539\u9020\u305b\u3088\u3002<\/p>\n<ul>\n<li>\u30d9\u30af\u30c8\u30eb\u306e\u6b21\u5143\u6570n\u3092\u5165\u529b<\/li>\n<li>\u5165\u529b\u3055\u308c\u305fn\u3092\u7528\u3044\u3066\u3001\uff12\u3064\u306en\u6b21\u5143\u30d9\u30af\u30c8\u30eb\u306e\u5185\u7a4d\u3092\u6c42\u3081\u308b<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"%e8%a4%87%e6%95%b0%e3%81%ae%e5%85%a5%e5%8a%9b%e5%80%a4%e3%81%ae%e6%9c%80%e5%a4%a7%e5%80%a4%ef%bc%88%e6%9c%80%e5%b0%8f%e5%80%a4%ef%bc%89%e3%82%92%e6%b1%82%e3%82%81%e3%82%8b\"><\/span>\u8907\u6570\u306e\u5165\u529b\u5024\u306e\u6700\u5927\u5024\uff08\u6700\u5c0f\u5024\uff09\u3092\u6c42\u3081\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u5b9f\u657010\u500b\u3092\u5165\u529b\u3057\u3066\u305d\u306e\u6700\u5927\u5024\u3092\u6c42\u3081\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059 (array-3.c) \u3002\u6700\u5927\u5024\u3092\u6c42\u3081\u308b\u3068\u304d\u306b\u306f\u3001\u4e00\u3064\u5909\u6570\u3092\u5225\u306b\u6e96\u5099\u3057\u3066\u305d\u308c\u3068\u6bd4\u3079\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u7c21\u5358\u3067\u3059\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">array-3.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n \r\n    \/* \u6574\u6570\u578b\u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i;\r\n    double max, c[10];\r\n \r\n    \/* \u5b9f\u6570\u578b\u914d\u5217\u306b\u5024\u3092\u5165\u529b\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 10; i++) {\r\n        printf(\"\u5b9f\u6570\u309210\u500b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08%d \u3064\u76ee\uff09 : \", i+1);\r\n        scanf(\"%lf\", &amp;c[i]);\r\n    }\r\n \r\n    \/* max \u306e\u521d\u671f\u5316 *\/\r\n    max = c[0];\r\n \r\n    \/* \u5927\u5c0f\u3092\u6bd4\u3079\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 1; i &lt; 10; i++) {\r\n        if (max &lt; c[i]) {\r\n            max = c[i];\r\n        }\r\n    }\r\n \r\n    \/* \u7d50\u679c\u3092\u8868\u793a *\/\r\n    printf(\" max = %lf \\n\", max);\r\n \r\n    return 0;\r\n}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%92\"><\/span><u>\u8ab2\u984c\uff12<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>array-3.c \u3092\u3001\u6700\u5927\u5024\u3068\u6700\u5c0f\u5024\u3068\u5e73\u5747\u5024\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u6539\u9020\u305b\u3088\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%93\"><\/span><u>\u8ab2\u984c\uff13<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>10 \u500b\u306e\u5b9f\u6570 R[0] \uff5eR[9] \u3092\u5165\u529b\u3059\u308b\u3068\u3001\u305d\u306e\u5185\u306e\u6700\u5927\u5024\u3068\uff12\u756a\u76ee\u306b\u5927\u304d\u3044\u5024\u3092\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u305b\u3088\u3002<br \/>\n(\u30d2\u30f3\u30c8\uff1a\u307e\u305a\u6700\u3082\u5927\u304d\u306a\u5024 max \u3092\u6c42\u3081\u3001\u305d\u306e\u3042\u3068\u3067 max &gt; R[i] \u3068\u306a\u308b\u6700\u3082\u5927\u304d\u3044 R[i] \u3092\u6c42\u3081\u3066\u8868\u793a\u3002)<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e5%a4%9a%e6%ac%a1%e5%85%83%e9%85%8d%e5%88%97%e5%a4%89%e6%95%b0\"><\/span>\u591a\u6b21\u5143\u914d\u5217\u5909\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u591a\u6b21\u5143\u914d\u5217\u3068\u3044\u3046\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002 \u591a\u6b21\u5143\u914d\u5217\u3092\u7528\u610f\u3059\u308b\u306b\u306f\u8981\u7d20\u3092\u6b21\u5143\u6570\u3060\u3051\u4e26\u3079\u3066\u5ba3\u8a00\u3059\u308b\u3060\u3051\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001<br \/>\nint a[2][3];<br \/>\n\u306a\u3069\u306e\u3088\u3046\u306b\u66f8\u304f\u3068\u6574\u6570\u578b\u306e a[0][0], a[0][1], a[0][2], a[1][0], a[1][1], a[1][2] \u306e6\u500b\u304c\u7528\u610f\u3055\u308c\u307e\u3059\u3002<br \/>\n1\u6b21\u5143\u914d\u5217\u3068\u540c\u69d8\u306b\u3001 double f[2][3]; \u3068\u3059\u308c\u3070\u5b9f\u6570\u578b\u306e\u914d\u5217\u304c\u5ba3\u8a00\u3055\u308c\u3001 \u3044\u305a\u308c\u306e\u5834\u5408\u3082\u914d\u5217\u5909\u6570\u306e\u6dfb\u5b57\u306b\u306f\u6574\u6570\u578b\u306e\u5909\u6570\u304c\u4f7f\u3048\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u4f7f\u3046\u3068\u884c\u5217\u306e\u304b\u3051\u7b97\u306a\u3069\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 65px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-574774e6d6f81be70eeb8dbbccc6ce71_l3.png\" height=\"65\" width=\"319\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#65;&#32;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#108;&#108;&#125;&#32;&#51;&#32;&#38;&#32;&#50;&#32;&#38;&#32;&#53;&#32;&#92;&#92;&#32;&#52;&#32;&#38;&#32;&#49;&#32;&#38;&#32;&#57;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#44;&#32;&#66;&#32;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#125;&#32;&#55;&#32;&#92;&#92;&#32;&#56;&#32;&#92;&#92;&#32;&#50;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#44;&#32;&#67;&#61;&#65;&#66;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>\u306e\u884c\u5217C\u306e\u8981\u7d20\u3092\u8a08\u7b97\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059 (array-4.c) \u3002\u6253\u3061\u8fbc\u3093\u3067\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">array-4.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n    \/* \u6574\u6570\u578b\u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i, j, a[2][3], b[3], c[2];\r\n \r\n    \/* \u6574\u6570\u578b\u914d\u5217 a \u306b\u5024\u3092\u5165\u529b *\/\r\n    a[0][0] = 3;\r\n    a[0][1] = 2;\r\n    a[0][2] = 5; \r\n    a[1][0] = 4;\r\n    a[1][1] = 1;\r\n    a[1][2] = 9;\r\n \r\n    \/* \u6574\u6570\u578b\u914d\u5217 b \u306b\u5024\u3092\u5165\u529b *\/\r\n    b[0] = 7;\r\n    b[1] = 8;\r\n    b[2] = 2;\r\n \r\n    \/* \u6574\u6570\u578b\u914d\u5217 c \u306e\u521d\u671f\u5316 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        c[i] = 0;\r\n    }\r\n \r\n    \/* \u5404\u6210\u5206\u3092\u8a08\u7b97\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        for (j = 0; j &lt; 3; j++) {\r\n            c[i] = c[i] + a[i][j] * b[j];\r\n        }\r\n    }\r\n \r\n    \/* \u7d50\u679c\u3092\u8868\u793a\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        printf(\" %d\u884c\u76ee\u306e\u6210\u5206\u3000= %d \\n\", i+1, c[i]);\r\n    }\r\n \r\n    return 0;\r\n}<\/pre>\n<p>\u4e0a\u306e\u4f8b\u306e\u3088\u3046\u306b\u3001\u30d9\u30af\u30c8\u30eb\u3084\u884c\u5217\u306a\u3069\u306e\u3059\u3067\u306b\u5024\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u3082\u306e\u306b\u5bfe\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u5024\u3092\u4ee3\u5165\u3059\u308b\u306e\u304c\u9762\u5012\u3001\u3068\u611f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u6b21\u306e\u3088\u3046\u306b\u5909\u6570\u306e\u5ba3\u8a00\u306b\u3042\u308f\u305b\u3066\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">array-4b.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n    \/* \u6574\u6570\u578b\u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i, j;\r\n    int a[2][3] = {{3,2,5},{4,1,9}};\r\n    int b[3] = {7,8,2};\r\n    int c[2];\r\n \r\n    \/* \u6574\u6570\u578b\u914d\u5217 c \u306e\u521d\u671f\u5316 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        c[i] = 0;\r\n    }\r\n \r\n    \/* \u5404\u6210\u5206\u3092\u8a08\u7b97\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        for (j = 0; j &lt; 3; j++) {\r\n            c[i] = c[i] + a[i][j] * b[j];\r\n        }\r\n    }\r\n    \r\n    \/* \u7d50\u679c\u3092\u8868\u793a\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 2; i++) {\r\n        printf(\" %d\u884c\u76ee\u306e\u6210\u5206\u3000= %d \\n\", i+1, c[i]);\r\n    }\r\n \r\n    return 0;\r\n}\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%94\"><\/span><span style=\"text-decoration: underline;\">\u8ab2\u984c\uff14<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 43px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-3822c8d1d6795dc7fb8b317e8f1e988e_l3.png\" height=\"43\" width=\"354\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#65;&#32;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#108;&#125;&#32;&#49;&#32;&#38;&#32;&#45;&#50;&#32;&#92;&#92;&#32;&#49;&#32;&#38;&#32;&#52;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#44;&#32;&#114;&#95;&#49;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#125;&#32;&#49;&#32;&#92;&#92;&#32;&#45;&#49;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#44;&#32;&#114;&#95;&#50;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#125;&#32;&#50;&#32;&#92;&#92;&#32;&#45;&#49;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p><b><\/b>\u3068\u3059\u308b\u3002<br \/>\n\u3053\u306e\u3068\u304d\u3001 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-b78ec24c281840f4ffa6b52844e84c44_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#51;&#32;&#114;&#95;&#49;&#44;&#32;&#65;&#94;&#51;&#114;&#95;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"81\" style=\"vertical-align: -4px;\"\/> \u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u305b\u3088\u3002<br \/>\n\uff08\u5b9f\u306f\u3001r1, r2\u306f\u884c\u5217A\u306e\u56fa\u6709\u30d9\u30af\u30c8\u30eb\u3067\u3001\u305d\u308c\u305e\u308c\u56fa\u6709\u50243, 2\u306b\u5bfe\u5fdc\u3059\u308b\uff09<br \/>\n\u6b21\u306e\u8ab2\u984c5\u3067\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u518d\u5229\u7528\u3059\u308b\u3053\u3068\u3092\u8003\u3048\u3066\u3001\u884c\u5217\u306e\u4e09\u4e57\u3092\u6c42\u3081\u308b\u306e\u3067\u306f\u306a\u304f\u3001<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 18px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-8177e73bb4b7a2d1e925474306d36ced_l3.png\" height=\"18\" width=\"83\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#65;&#40;&#65;&#40;&#65;&#114;&#95;&#49;&#41;&#41;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>\u3092\u6c42\u3081\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3059\u308b\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%95\"><\/span><span style=\"text-decoration: underline;\">\u8ab2\u984c\uff15<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u975e\u8ca0\u306e\u6574\u6570n\u306b\u3064\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u95a2\u4fc2\u5f0f\u304c\u6210\u308a\u7acb\u3064\u3068\u3059\u308b\u3002<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 41px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-337df19986b264a077bb3a23237b843e_l3.png\" height=\"41\" width=\"112\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#118;&#95;&#123;&#110;&#43;&#49;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#65;&#118;&#95;&#110;&#125;&#123;&#124;&#124;&#65;&#118;&#95;&#110;&#124;&#124;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>\u305f\u3060\u3057\u3001<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 43px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-4c7eee940f317d76b83f4a5448e0a46f_l3.png\" height=\"43\" width=\"235\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#65;&#32;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#108;&#125;&#32;&#49;&#32;&#38;&#32;&#45;&#50;&#32;&#92;&#92;&#32;&#49;&#32;&#38;&#32;&#52;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#44;&#32;&#118;&#95;&#48;&#32;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#108;&#125;&#32;&#120;&#95;&#48;&#32;&#92;&#92;&#32;&#121;&#95;&#48;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>\u3067\u3042\u308b\u3068\u3057\u3001||\u30fb||\u306f\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\uff08\u81ea\u8eab\u3068\u306e\u5185\u7a4d\u306e\u5e73\u65b9\u6839\uff09\u3092\u8868\u3059\u3082\u306e\u3068\u3059\u308b\u3002<br \/>\n\u5b9f\u6570<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-0ef0a49d51c8cfd13e37df1b9090418b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#95;&#48;&#44;&#32;&#121;&#95;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"42\" style=\"vertical-align: -4px;\"\/>\u306e\u5165\u529b\u3092\u4fc3\u3057\u3001<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-e89f4a38f4c5cf9a727dc9f8d0e7904a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#118;&#95;&#123;&#49;&#48;&#48;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"30\" style=\"vertical-align: -4px;\"\/>\u306e\u7b2c\uff11\u6210\u5206\u3068\u7b2c\uff12\u6210\u5206\u3092\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u305b\u3088\u3002<br \/>\n\u69d8\u3005\u306a<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wordpress\/wp-content\/ql-cache\/quicklatex.com-0ef0a49d51c8cfd13e37df1b9090418b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#95;&#48;&#44;&#32;&#121;&#95;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"42\" style=\"vertical-align: -4px;\"\/>\u3092\u5165\u308c\u3066\u3001\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u7d50\u679c\u3092\u56fa\u6709\u30d9\u30af\u30c8\u30ebr1\u3001r2\u3068\u898b\u6bd4\u3079\u3066\u3001<br \/>\n\u306a\u305c\u3001\u305d\u306e\u3088\u3046\u306a\u7d50\u679c\u306b\u306a\u308b\u306e\u304b\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%96\"><\/span><u>\u8ab2\u984c\uff16<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>(array-4.c \u7b49\u3092\u53c2\u8003\u306b) 5 \u884c 5 \u5217 (n \u884c n \u5217) \u306e\u884c\u5217\u540c\u58eb\u306e\u304b\u3051\u7b97\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u305b\u3088\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e8%aa%b2%e9%a1%8c%ef%bc%97\"><\/span><u>\u8ab2\u984c\uff17<\/u><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>10\u500b\u306e\u5b9f\u6570 A[0] \uff5e A[9] \u3092\u5165\u529b\u3059\u308b\u3068\u3001\u305d\u308c\u3089\u3092\u5024\u306e\u5927\u304d\u3044\u9806\u306b\u4e26\u3079\u66ff\u3048\u3066\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u305b\u3088\u3002<br \/>\n\u203b \u30bd\u30fc\u30c8\u554f\u984c\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3067\u3059\u3002\u30bd\u30fc\u30c8\u554f\u984c\u306b\u5bfe\u3059\u308b\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u8272\u3005\u3042\u308a\u307e\u3059\u304c\u3001\u307e\u305a\u306f\u8a08\u7b97\u901f\u5ea6\u5ea6\u5916\u8996\u3067\u3001\u96a3\u63a5\u3059\u308b\u6570\u5024\u3092\u5165\u308c\u66ff\u3048\u3066\u3044\u304f\u30d0\u30d6\u30eb\u30bd\u30fc\u30c8\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u4f59\u88d5\u304c\u3042\u308b\u306a\u3089\u3001\u9078\u629e\u30bd\u30fc\u30c8\u3084\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u306a\u3069\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%ef%bc%88%e3%81%8a%e3%81%be%e3%81%91%ef%bc%89%e6%95%b0%e5%80%a4%e3%81%ae%e5%85%a5%e5%8a%9b%e5%9b%9e%e6%95%b0%e3%82%92%e3%82%ab%e3%82%a6%e3%83%b3%e3%83%88%e3%81%99%e3%82%8b\"><\/span>\uff08\u304a\u307e\u3051\uff09\u6570\u5024\u306e\u5165\u529b\u56de\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6b21\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001 1 \uff5e 9 \u3044\u305a\u308c\u304b\u306e\u81ea\u7136\u6570\u3092\u6253\u3061\u8fbc\u3080\u3068\u3001\u305d\u308c\u305e\u308c\u4f55\u56de\u5165\u529b\u3055\u308c\u305f\u304b\u3092\u6570\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059 (array-5.c) \u30020 \u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u5165\u529b\u3092\u7d42\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u3046\u3044\u3063\u305f\u69cb\u9020\u306f\u3001\u5206\u5e03\u3084\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u6709\u7528\u3067\u3059\u3002<strong>\uff08\u9014\u4e2d if \u6587\u306e\u5165\u308c\u5b50\u304c\u3042\u308a\u307e\u3059\u3002\u5165\u308c\u5b50\u69cb\u9020\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u5b57\u4e0b\u3052\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5b57\u4e0b\u3052\u306b\u3088\u3063\u3066\u3001\u69cb\u9020\u304c\u3088\u304f\u308f\u304b\u308b\u306f\u305a\u3067\u3059\u3002\uff09<\/strong><br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/p>\n<p><span style=\"text-decoration: underline;\">array-5.c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\r\n \r\nint main() {\r\n \r\n    \/* \u6574\u6570\u578b\u5909\u6570\u306e\u5ba3\u8a00 *\/\r\n    int i, n, c[9];\r\n \r\n    \/* \u6574\u6570\u578b\u914d\u5217\u306e\u521d\u671f\u5316\u3092\u884c\u3046\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 9; i++) {\r\n        c[i] = 0;\r\n    }\r\n \r\n    \/* n \u306e\u521d\u671f\u5316\uff08while\u6587\u306e\u6761\u4ef6\u5f0f\u3092\u306f\u3058\u3081\u304b\u3089\u6e80\u305f\u3055\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\uff09 *\/\r\n    n = -1;\r\n \r\n    \/* 0 \u304c\u5165\u529b\u3055\u308c\u308b\u307e\u3067\u5165\u529b\u3092\u53d7\u3051\u3064\u3065\u3051\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    while (n != 0) {\r\n        printf(\"1 \uff5e 9 \u3044\u305a\u308c\u304b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff080 \u3067\u5165\u529b\u7d42\u308f\u308a\uff09\uff1a \");\r\n        scanf(\"%d\", &amp;n);\r\n \r\n        \/* \u5165\u529b\u3055\u308c\u305f n \u306e\u59a5\u5f53\u6027\u3092\u30c1\u30a7\u30c3\u30af *\/\r\n        if ((n &lt;=0) || (n &gt; 9)) {\r\n            if(n == 0) {\r\n                \/* n \u304c 0 \u3060\u3063\u305f\u5834\u5408 *\/\r\n                printf(\"0 \u304c\u5165\u529b\u3055\u308c\u307e\u3057\u305f\u3002\u5165\u529b\u3092\u7d42\u308f\u308a\u307e\u3059\u3002\\n\");\r\n            }\r\n \r\n            else {\r\n                \/* n \u306e\u7bc4\u56f2\u304c\u4e0d\u5f53\u3060\u3063\u305f\u5834\u5408 *\/\r\n                printf(\"1 \uff5e 9 \u4ee5\u5916\u306e\u6570\u5024\u304c\u5165\u529b\u3055\u308c\u307e\u3057\u305f\u3002\u7121\u8996\u3057\u307e\u3059\u3002\\n\");\r\n            }\r\n        }\r\n \r\n        else {\r\n            \/* n \u304c 1 \uff5e 9 \u3067\u3042\u3063\u305f\u5834\u5408\u3001c[n-1] \u306e\u5024\u3092\u4e00\u3064\u5897\u3084\u3059 *\/\r\n            \/* n-1 \u3068\u306a\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u6dfb\u3048\u5b57\u304c 0 \u304b\u3089\u59cb\u307e\u308b\u3053\u3068\u306b\u3088\u308b *\/\r\n            c[n-1]=c[n-1]+1;\r\n        }\r\n    }\r\n \r\n    \/* \u7d50\u679c\u3092\u8868\u793a\u3059\u308b\u7e70\u308a\u8fd4\u3057\u6587 *\/\r\n    for (i = 0; i &lt; 9; i++) {\r\n        printf(\"%d \u304c %d \u56de\u5165\u529b\u3055\u308c\u307e\u3057\u305f\u3002\\n\", i+1, c[i]);\r\n    }\r\n \r\n    return 0;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u5217 \u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u6f14\u7fd2\u3092\u884c\u3044\u307e\u3059\u3002 \u914d\u5217\u5909\u6570 \u914d\u5217\u3068\u7e70\u308a\u8fd4\u3057\u6587\u3092\u7528\u3044\u305f\u6f14\u7b97 \u4eca\u65e5\u306e\u76ee\u6a19 \u914d\u5217\u3092\u7406\u89e3\u3059\u308b\u3002 \u7e70\u308a\u8fd4\u3057\u6587\u3084\u914d\u5217\u5909\u6570\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5229\u7528\u3059\u308b\u3002 \u914d\u5217\u5909\u6570\u306e\u5ba3\u8a00\u3068\u5229\u7528 C\u8a00\u8a9e\u306b\u9650\u3089\u305a\u3001\u307b\u3068\u3093\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u306f &hellip; <a href=\"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/%e6%8e%88%e6%a5%ad%e8%b3%87%e6%96%99\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92\/%e8%a8%88%e7%ae%97%e6%95%b0%e5%ad%a6%e6%bc%94%e7%bf%92%e7%ac%ac%ef%bc%97%e5%9b%9e\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u8a08\u7b97\u6570\u5b66\u6f14\u7fd2\u7b2c\uff17\u56de<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1691,"menu_order":36,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1788","page","type-page","status-publish","hentry"],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/PaSLRw-sQ","_links":{"self":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/pages\/1788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/comments?post=1788"}],"version-history":[{"count":19,"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/pages\/1788\/revisions"}],"predecessor-version":[{"id":3551,"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/pages\/1788\/revisions\/3551"}],"up":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/pages\/1691"}],"wp:attachment":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~mafujii\/wp-json\/wp\/v2\/media?parent=1788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}