{"id":1693,"date":"2026-05-31T00:59:20","date_gmt":"2026-05-30T16:59:20","guid":{"rendered":"http:\/\/wordpress.fangt.online\/?p=1693"},"modified":"2026-05-31T00:59:20","modified_gmt":"2026-05-30T16:59:20","slug":"1400%ef%bc%9a%e7%bb%9f%e8%ae%a1%e5%8d%95%e8%af%8d%e6%95%b0","status":"publish","type":"post","link":"http:\/\/wordpress.fangt.online\/index.php\/2026\/05\/31\/1400%ef%bc%9a%e7%bb%9f%e8%ae%a1%e5%8d%95%e8%af%8d%e6%95%b0\/","title":{"rendered":"1400\uff1a\u7edf\u8ba1\u5355\u8bcd\u6570"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include&lt;bits\/stdc++.h>\nusing namespace std;\nint main()\n{\n\tstring word,jv,s;\n\tint sum=0,p,len; \n\tgetline(cin,word);\n\tgetline(cin,jv);\n\tint a=word.size();\n\tint b=jv.size();\n\tfor(int i=0;i&lt;a;i++)\n\t{\n\t word&#91;i]=tolower(word&#91;i]);\n\t}\n\tfor(int i=0;i&lt;b;i++)\n\t{\n\t jv&#91;i]=tolower(jv&#91;i]);\t\n    }\n\tfor(int i=0;i&lt;b;i++)\n\t{\n\t\tif(jv&#91;i]!=' ')\n\t\t{\n\t\t s=s+jv&#91;i];\n\t    }\n\t\telse\n\t\t{\n\t\t\tlen = s.size();\n\t\t\tif(word==s)\n\t\t\t{\n\t\t\t\tsum++; \/\/ \u7b2c\u4e00\u4e2a\n\t\t\t\tif(sum==1)\n\t\t\t\t{\n\t\t\t\t\tp=i-len;\/\/ 2-2  0\n\t\t\t    }\n\t\t\t}\n\t\t\ts=\"\";\n\t\t}\n\t}\n\tif(sum==0)\n\t{\n\t\tcout&lt;&lt;-1;\n\t}\n\telse\n\t{\n\t\tcout&lt;&lt;sum&lt;&lt;\" \"&lt;&lt;p; \/\/ \u4e0b\u6807\n\t} \n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#include&lt;bits\/stdc++.h>\nusing namespace std;\nstring Atoa(string s){\n\tfor(int i=0;s&#91;i];i++)\n\t\tif(s&#91;i]&lt;97) s&#91;i]+=32;\n\treturn s;\n}\nstring a,s,ss;\nint ks=0;\nqueue&lt;int> q;\nint main(){\n\tcin>>a;\n\ta=Atoa(a);\n\tcin.ignore();\n\tgetline(cin,s);\n\tfor(int i=0;s&#91;i];i++){\n\t\tif(s&#91;i]==' '){\n\t\t\tss=s.substr(ks,i-ks);\n\t\t\tif(Atoa(ss)==a) q.push(ks);\n\t\t\tks=i+1;\n\t\t}\n\t} \n\tif(q.size()==0) cout&lt;&lt;-1;\n\telse cout&lt;&lt;q.size()&lt;&lt;\" \"&lt;&lt;q.front();\n\treturn 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1693","post","type-post","status-publish","format-standard","hentry","category-st"],"_links":{"self":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/1693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/comments?post=1693"}],"version-history":[{"count":1,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/1693\/revisions"}],"predecessor-version":[{"id":1694,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/1693\/revisions\/1694"}],"wp:attachment":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/media?parent=1693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/categories?post=1693"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/tags?post=1693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}