{"id":90153,"date":"2024-03-21T12:05:46","date_gmt":"2024-03-21T03:05:46","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2024-03-28T14:39:10","modified_gmt":"2024-03-28T05:39:10","slug":"c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b sort \u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">#<span class=\"hljs-keyword\">include<\/span> <span class=\"hljs-string\">&lt;algorithm&gt;<\/span> <span class=\"hljs-comment\">\/\/ \u5305\u542bsort\u51fd\u6570\u7684\u5934\u6587\u4ef6<\/span><\/span>\r\n<span class=\"hljs-meta\">#<span class=\"hljs-keyword\">include<\/span> <span class=\"hljs-string\">&lt;vector&gt;<\/span> <span class=\"hljs-comment\">\/\/ \u5305\u542bvector\u5bb9\u5668\u7684\u5934\u6587\u4ef6<\/span><\/span>\r\n\r\n<span class=\"hljs-function\"><span class=\"hljs-type\">int<\/span> <span class=\"hljs-title\">main<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\r\n    <span class=\"hljs-type\">int<\/span> n = <span class=\"hljs-number\">10<\/span>; <span class=\"hljs-comment\">\/\/ \u5047\u8bbe\u670910\u4e2a\u6570\u636e<\/span>\r\n    std::vector&lt;<span class=\"hljs-type\">int<\/span>&gt; nums = {<span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">0<\/span>}; <span class=\"hljs-comment\">\/\/ \u5047\u8bbe\u8fd9\u662f\u6570\u636e\u96c6\u5408<\/span>\r\n\r\n    std::<span class=\"hljs-built_in\">sort<\/span>(nums.<span class=\"hljs-built_in\">begin<\/span>(), nums.<span class=\"hljs-built_in\">end<\/span>()); <span class=\"hljs-comment\">\/\/ \u4f7f\u7528sort\u51fd\u6570\u5bf9\u5bb9\u5668\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6392\u5e8f<\/span>\r\n\r\n    <span class=\"hljs-keyword\">for<\/span> (<span class=\"hljs-type\">int<\/span> i = <span class=\"hljs-number\">0<\/span>; i &lt; n; i++) {\r\n        std::cout &lt;&lt; nums[i] &lt;&lt; <span class=\"hljs-string\">\" \"<\/span>; <span class=\"hljs-comment\">\/\/ \u8f93\u51fa\u6392\u5e8f\u540e\u7684\u6570\u636e<\/span>\r\n    }\r\n\r\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\r\n}\r\n<\/code><\/pre>\n<p>\u7d50\u679c\u306f\u300c0 1 2 3 4 5 6 7 8 9\u300d\u306a\u306e\u3067\u3001\u30c7\u30fc\u30bf\u306f\u5c0f\u3055\u3044\u9806\u306b\u4e26\u3079\u66ff\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b sort \u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 #include &lt;algorithm&gt; \/\/ \u5305\u542bsort\u51fd\u6570\u7684\u5934\u6587\u4ef6 #include &lt;ve [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-90153","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/c-\u3067-n-\u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b sort \u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 #include &lt;algorithm&gt; \/\/ \u5305\u542bsort\u51fd\u6570\u7684\u5934\u6587\u4ef6 #include &lt;ve [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/c-\u3067-n-\u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-21T03:05:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-28T05:39:10+00:00\" \/>\n<meta name=\"author\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-21T03:05:46+00:00\",\"dateModified\":\"2024-03-28T05:39:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\",\"name\":\"\u512a\u6597, \u671d\u967d\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"caption\":\"\u512a\u6597, \u671d\u967d\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/c-\u3067-n-\u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5","og_description":"\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b sort \u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 #include &lt;algorithm&gt; \/\/ \u5305\u542bsort\u51fd\u6570\u7684\u5934\u6587\u4ef6 #include &lt;ve [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/c-\u3067-n-\u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-21T03:05:46+00:00","article_modified_time":"2024-03-28T05:39:10+00:00","author":"\u512a\u6597, \u671d\u967d","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u512a\u6597, \u671d\u967d"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-21T03:05:46+00:00","dateModified":"2024-03-28T05:39:10+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"C++ \u3067 n \u500b\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28","name":"\u512a\u6597, \u671d\u967d","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","caption":"\u512a\u6597, \u671d\u967d"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/c-%e3%81%a7-n-%e5%80%8b%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%98%87%e9%a0%86%e3%81%ab%e3%82%bd%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=90153"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90153\/revisions"}],"predecessor-version":[{"id":206799,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90153\/revisions\/206799"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=90153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=90153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=90153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}