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

📄 subject_34041.htm

📁 vc
💻 HTM
字号:
<p>
序号:34041 发表者:思荣 发表日期:2003-03-26 10:24:05
<br>主题:面试的考题
<br>内容:把一个字符串分成两个串,如abc/cde,要求程序分别输出 first:abc&nbsp;&nbsp;second:cde要用C语言<BR>有一个file.txt文件,它的内容是 123&nbsp;&nbsp;789 456 901 234 ,将其从文件读出,从小到大排列,结果存入output.txt<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:(zl剑客) 回复日期:2003-03-26 11:08:46
<br>内容:1.<BR> #include "stdafx.h"<BR>#include &lt;stdio.h&gt;<BR><BR>#define MAX_LEN&nbsp;&nbsp;64<BR><BR>int _tmain(int argc, _TCHAR* argv[])<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;char szFirst[MAX_LEN];<BR>&nbsp;&nbsp;&nbsp;&nbsp;char szSecond[MAX_LEN];<BR>&nbsp;&nbsp;&nbsp;&nbsp;char szTemp[2*MAX_LEN];<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;char *szPoint;<BR>&nbsp;&nbsp;&nbsp;&nbsp;char *szSource = "abc/cde";<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;szPoint = strchr(szSource,'/');<BR>&nbsp;&nbsp;&nbsp;&nbsp;int num = szPoint - szSource;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;strncpy(szFirst,szSource,num);<BR>&nbsp;&nbsp;&nbsp;&nbsp;szFirst[num] = '\0';<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;strcpy(szSecond,szPoint+1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;sprintf(szTemp,"first:%s ",szFirst);<BR>&nbsp;&nbsp;&nbsp;&nbsp;printf("%s",szTemp);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;sprintf(szTemp,"second:%s",szSecond);<BR>&nbsp;&nbsp;&nbsp;&nbsp;printf("%s\n",szTemp);<BR>&nbsp;&nbsp;&nbsp;&nbsp;return 0;<BR>}<BR><BR><BR>2003-3-26 11:19:18

⌨️ 快捷键说明

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