⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 字符串操作_hello123.htm

📁 关于C+编程思想的课件
💻 HTM
📖 第 1 页 / 共 2 页
字号:
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>2)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; char chs[] = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; string s(chs);<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>3)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; char chs[] = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; string s(chs,1,3);&nbsp;&nbsp;&nbsp; 
      //指定从chs的索引1开始,最后复制3个字节<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>4)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string 
      s1("hehe");<BR>&nbsp;&nbsp;&nbsp; string s2(s1);&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;s2&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>5)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string 
      s1("hehe",2,3);<BR>&nbsp;&nbsp;&nbsp; string s2(s1);&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;s2&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>6)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; char chs[] = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; string s(chs,3);&nbsp;&nbsp;&nbsp; 
      //将chs前3个字符作为初值构造<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>7)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string 
      s(10,'k');&nbsp;&nbsp;&nbsp; //分配10个字符,初值都是'k'<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>//以上是string类实例的构造手段,都很简单.</P>
      <P>9)<BR>//赋新值<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string 
      s(10,'k');&nbsp;&nbsp;&nbsp; //分配10个字符,初值都是'k'<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; s = 
      "hehehehe";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.assign("kdje");<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.assign("fkdhfkdfd",5);&nbsp;&nbsp;&nbsp; 
      //重新分配指定字符串的前5的元素内容<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>10)<BR>//swap方法交换<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s1 = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; string s2 = "gagaga";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;"s1 : "&lt;&lt;s1&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;"s2 : "&lt;&lt;s2&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s1.swap(s2);<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"s1 : 
      "&lt;&lt;s1&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"s2 : 
      "&lt;&lt;s2&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>11)<BR>//+=,append(),push_back()在尾部添加字符<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; s += "gaga";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.append("嘿嘿");&nbsp;&nbsp;&nbsp; 
      //append()方法可以添加字符串<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.push_back('k');&nbsp;&nbsp;&nbsp; 
      //push_back()方法只能添加一个字符...<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>12)<BR>//insert() 
      插入字符.其实,insert运用好,与其他的插入操作是一样的.<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "hehe";<BR>&nbsp;&nbsp;&nbsp; 
      s.insert(0,"头部");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      //在头部插入<BR>&nbsp;&nbsp;&nbsp; s.insert(s.size(),"尾部");&nbsp;&nbsp;&nbsp; 
      //在尾部插入<BR>&nbsp;&nbsp;&nbsp; 
      s.insert(s.size()/2,"中间");//在中间插入<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>13)<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; s.erase(0,1);&nbsp;&nbsp;&nbsp; 
      //从索引0到索引1,即删除掉了'a'<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      //其实,还可以使用replace方法来执行删除操作<BR>&nbsp;&nbsp;&nbsp; 
      s.replace(2,3,"");//即将指定范围内的字符替换成"",即变相删除了<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; cin.get();<BR>}</P>
      <P>14)<BR>//clear() 删除全部字符<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.length()&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.clear();<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.length()&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      //使用earse方法变相全删除<BR>&nbsp;&nbsp;&nbsp; s = "dkjfd";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.length()&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      s.erase(0,s.length());<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.length()&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>15)<BR>//replace() 
      替换字符<BR>#include &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using 
      namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; 
      s.replace(2,3,"!!!!!");//从索引2开始3个字节的字符全替换成"!!!!!"<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>16)<BR>//==,!=,&lt;,&lt;=,&gt;,&gt;=,compare()&nbsp; 
      比较字符串<BR>#include &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using 
      namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s1 = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; string s2 = "abcdefg";&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; if (s1==s2)cout&lt;&lt;"s1 == 
      s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; else cout&lt;&lt;"s1 != 
      s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; if 
      (s1!=s2)cout&lt;&lt;"s1 != s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; else 
      cout&lt;&lt;"s1 == s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; if (s1&gt;s2)cout&lt;&lt;"s1 &gt; 
      s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; else cout&lt;&lt;"s1 &lt;= 
      s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; if 
      (s1&lt;=s2)cout&lt;&lt;"s1 &lt;= s2"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      else cout&lt;&lt;"s1 &gt; s2"&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>17)<BR>//size(),length()&nbsp; 
      返回字符数量<BR>#include &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using 
      namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.size()&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.length()&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>18)<BR>//max_size() 
      返回字符的可能最大个数<BR>#include &lt;string&gt;<BR>#include 
      &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg";<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;s.max_size()&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>19)<BR>//empty()&nbsp; 
      判断字符串是否为空<BR>#include &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using 
      namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s ;<BR>&nbsp;&nbsp;&nbsp; 
      if (s.empty())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;"s 为空."&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;"s 
      不为空."&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; s = s + "abcdefg";<BR>&nbsp;&nbsp;&nbsp; if 
      (s.empty())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;"s 
      为空."&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;"s 
      不为空."&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>20)<BR>// [ ], at() 
      存取单一字符<BR>#include &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using 
      namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg1111";<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;"use []:"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; for(int i=0; 
      i&lt;s.length(); i++)<BR>&nbsp;&nbsp;&nbsp; 
      {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s[i]&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"use 
      at():"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; for(int i=0; i&lt;s.length(); 
      i++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;s.at(i)&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      <BR>&nbsp;&nbsp;&nbsp; cin.get();<BR>}<BR>21)<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg1111";<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; const char * 
      chs1 = s.c_str();<BR>&nbsp;&nbsp;&nbsp; const char * chs2 = s.data();</P>
      <P>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"use 
      at():"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; int i;<BR>&nbsp;&nbsp;&nbsp; 
      for(i=0; i&lt;s.length(); i++)<BR>&nbsp;&nbsp;&nbsp; 
      {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;"c_str() : 
      "&lt;&lt;chs1[i]&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;"data() : "&lt;&lt;chs2[i]&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"c_str() : 
      "&lt;&lt;chs1&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"data() : 
      "&lt;&lt;chs2&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>22)<BR>// substr() 返回某个子字符串<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg1111";<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; string str = 
      s.substr(5,3);//从索引5开始3个字节<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;str&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>23)<BR>// find 查找函数<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg1111";<BR>&nbsp;&nbsp;&nbsp; string pattern = 
      "fg";<BR>&nbsp;&nbsp;&nbsp; string::size_type pos;<BR>&nbsp;&nbsp;&nbsp; 
      pos = s.find(pattern,0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      //从索引0开始,查找符合字符串"f"的头索引<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;pos&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; string str = 
      s.substr(pos,pattern.size());<BR>&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;str&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>24)<BR>// begin() end() 提供类似STL的迭代器支持<BR>#include 
      &lt;string&gt;<BR>#include &lt;iostream&gt;<BR>using namespace std;</P>
      <P>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp; string s = 
      "abcdefg1111";<BR>&nbsp;&nbsp;&nbsp; for(string::iterator iter = 
      s.begin(); iter!=s.end(); iter++)<BR>&nbsp;&nbsp;&nbsp; 
      {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      cout&lt;&lt;*iter&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;endl;</P>
      <P>&nbsp;&nbsp;&nbsp; 
      cin.get();<BR>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      一个C++字符串存在三种大小:a)现有的字符数,函数是size()和length(),他们等效。 
      Empty()用来检查字符串是否为空。b)max_size() 
      这个大小是指当前C++字符串最多能包含的字符数,很可能和机器本身的限制或者字符串所在位置连续内存的大小有关系。我们一般情况下不用关心他,应该大小足够我们用的。但是不够用的话,会抛出length_error异常c)capacity()重新分配内存之前 
      string所能包含的最大字符数。这里另一个需要指出的是reserve()函数,这个函数为string重新分配内存。重新分配的大小由其参数决定,默认参数为0,这时候会对string进行非强制性缩减<BR></P></DIV></TD></TR></TBODY></TABLE><BR>
<DIV class=opt><A title=查看该分类中所有文章 
href="http://hi.baidu.com/haolth/blog/category/c++">类别:c++</A> | 浏览(<SPAN 
id=result></SPAN>) </DIV>
<DIV class=line></DIV>
<SCRIPT language=JavaScript>
allkey=allkey+"a88f74cf5a759b3df9dc6100_bce6524ea670c409b3de05be_";
</SCRIPT>

<DIV id=in_comment><A name=comment></A>
<DIV class=tit>网友评论:</DIV>
<SCRIPT>
function writecmt(type,id,cmtname,cmturl,cmttime){
	var html1="";
	if(type==1){
		if(cmturl==""){
			html1="<a name='"+id+"'>"+cmtname+"</a> - <span class='date'>"+cmttime+"</span> ";
		}else{
			html1="<a name='"+id+"' href='"+cmturl+"' target='_blank' title='"+cmturl+"'>"+cmtname+"</a> - <span class='date'>"+cmttime+"</span> ";
		}
	}else{
		if(cmtname=="匿名网友"){
			if(cmturl==""){
				html1="<a name='"+id+"'>"+cmtname+"</a> - <span class='date'>"+cmttime+"</span> ";
			}else{
				html1="<a name='"+id+"' href='"+cmturl+"' target='_blank' title='"+cmturl+"'>"+cmtname+"</a> - <span class='date'>"+cmttime+"</span>";
			}
		}else{
			if(cmturl==""){
				html1="<div class='f14' style='display:inline'>网友:<a name='"+id+"'>"+cmtname+"</a> - <span class=\"date\">"+cmttime+"</span></div>";
			}else{
				html1="<div class='f14' style='display:inline'>网友:<a name='"+id+"' href='"+cmturl+"' target='_blank' title='"+cmturl+"'>"+cmtname+"</a> - <span class=\"date\">"+cmttime+"</span></div>";
			}
		}
	}
	document.write(html1);
}

</SCRIPT>

<DIV id=page></DIV></DIV>
<DIV id=in_send>
<FORM id=popFormSubmit name=form1 onsubmit="return checkcmtform()" 
action=http://hiup.baidu.com/haolth/commit method=post><INPUT type=hidden 
value=8 name=ct> <INPUT type=hidden value=1 name=cm> <INPUT type=hidden 
value=bce6524ea670c409b3de05be name=spBlogID>
<SCRIPT language=JavaScript>
	document.write("<input type='hidden' name='spRefURL' value='"+window.location.href+"'>");
</SCRIPT>
 
<DIV class=tit>发表评论:</DIV>
<TABLE cellSpacing=5 cellPadding=0 width=620 border=0>
  <TBODY>
  <TR>
    <TD class=f14>姓 名:</TD>
    <TD><INPUT id=spBlogCmtor style="WIDTH: 220px" onfocus=hidErr(1); 
      maxLength=49 onchange="checkname('spBlogCmtor')" name=spBlogCmtor>
      <DIV id=nmerror style="DISPLAY: none">*姓名最长为50字节</DIV></TD></TR>
  <TR id=1_err style="DISPLAY: none">
    <TD>&nbsp;</TD>
    <TD>
      <DIV class=error id=1_err_con></DIV></TD></TR>
  <TR>
    <TD class=f14>网址或邮箱:</TD>
    <TD><INPUT id=spBlogCmtURL style="WIDTH: 360px" onfocus=hidErr(2); 
      maxLength=128 onchange="checkeandu('spBlogCmtURL')" name=spBlogCmtURL> 
    (选填)</TD>
    <SCRIPT>
G("spBlogCmtor").value="";
G("spBlogCmtURL").value="";
</SCRIPT>
  </TR>
  <TR id=2_err style="DISPLAY: none">
    <TD>&nbsp;</TD>
    <TD>
      <DIV class=error id=2_err_con></DIV></TD></TR>
  <TR>
    <TD class=f14 vAlign=top>内 容:</TD>
    <TD><TEXTAREA id=spBlogCmtText style="WIDTH: 520px; HEIGHT: 155px" onfocus=showverkey();hidErr(3); name=spBlogCmtText></TEXTAREA>
      <SCRIPT>
G("spBlogCmtText").value="";
</SCRIPT>
       </TD></TR>
  <TR id=3_err style="DISPLAY: none">
    <TD>&nbsp;</TD>
    <TD>
      <DIV class=error id=3_err_con></DIV></TD></TR>
  <TR id=vercode>
    <TD class=f14 vAlign=top>验证码:</TD>
    <TD vAlign=top><INPUT type=hidden 
      value=F14F931B615949FDB48F1621426D09085A125D585C758C98135A76E2F47A316DCD7393B265C597941C8FA15C3732F5E6149F10928F233B86850FEE489AAF1A92 
      name=spVcode> <INPUT maxLength=4 size=6 name=spVerifyKey 
      autocomplete="off">请输入下图中的四位验证码,字母不区分大小写。<BR>
      <SCRIPT language=JavaScript>

			var imgsrc="http://post.baidu.com/cgi-bin/genimg?F14F931B615949FDB48F1621426D09085A125D585C758C98135A76E2F47A316DCD7393B265C597941C8FA15C3732F5E6149F10928F233B86850FEE489AAF1A92";
			document.write("<img id='verifypic' src='"+imgsrc+"' width='120' height='40'>");

			function newverifypic(){
				document.getElementById("verifypic").src = imgsrc +"&t="+ Math.random();
			}
		</SCRIPT>
      <A title=看不清左边的字符 href="javascript:newverifypic();">看不清?</A> </TD></TR>
  <TR>
    <TD class=f14 vAlign=top>&nbsp;</TD>
    <TD class=f14 
  vAlign=top><INPUT type=submit value=发表评论 name=btn_ok></TD></TR></TBODY></TABLE></FORM></DIV><BR></DIV>
<TABLE height=8 cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=modbl width=7>&nbsp;</TD>
    <TD class=modbc>&nbsp;</TD>
    <TD class=modbr width=7>&nbsp;</TD></TR></TBODY></TABLE></DIV></DIV></DIV></DIV>
<SCRIPT language=javascript>
<!--
var hstr="/haolth/brwstat?key1=1";
document.write("<script src='"+hstr+"&key2="+allkey+"'><\/script>");
//-->
</SCRIPT>
<BR>
<CENTER>
<DIV id=ft>&copy;2007 Baidu</DIV></CENTER>
<SCRIPT>
if(document.getElementById("m_blog"))
{
	var imgarray = document.getElementById("m_blog").getElementsByTagName('img');
	var imgw = document.getElementById("m_blog").offsetWidth;
	imgw =imgw-40;
	for(var i=0; i<imgarray.length; i++){
	if(imgarray[i].className=="blogimg" && imgarray[i].width>=imgw) imgarray[i].width=imgw;
	}
}
</SCRIPT>
</CENTER><IMG style="DISPLAY: none" src=""> </BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -