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

📄 subject_59788.htm

📁 vc
💻 HTM
字号:
<p>
序号:59788 发表者:shiguangling 发表日期:2003-11-10 14:00:53
<br>主题:一个的c语言问题,欢迎大家回复。谢谢
<br>内容:/*#include &lt;stdio.h&gt;*/<BR>typedef struct node<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int data;<BR>&nbsp;&nbsp;&nbsp;&nbsp;struct node *next;<BR>}linklist;<BR>main()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;linklist *head=creatlist();<BR>&nbsp;&nbsp;&nbsp;&nbsp;while(head){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&#34;%c &#34;,head-&gt;data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head=head-&gt;next;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<BR>print(linklist *<BR>linklist * creatlist()<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char ch;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linklist *head,*p;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch=getchar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(ch!='$')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p=malloc(sizeof(linklist));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p-&gt;data=ch;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p-&gt;next=head;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head=p;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch=getchar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return(head);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:bottle_fish 回复日期:2003-11-10 14:25:29
<br>内容:创建一个琏表,什么问题?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:ljl 回复日期:2003-11-10 14:25:36
<br>内容:这是你想要得吗?<BR><BR>#include &lt;stdio.h&gt;<BR>#include &lt;malloc.h&gt;<BR><BR>typedef struct node<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int data;<BR>&nbsp;&nbsp;&nbsp;&nbsp;struct node *next;<BR>}linklist;<BR><BR>linklist *creatlist();<BR><BR>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;linklist *head=creatlist();<BR>&nbsp;&nbsp;&nbsp;&nbsp;while(head){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&#34;%c &#34;,head-&gt;data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head=head-&gt;next;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<BR>//print(linklist *<BR>linklist * creatlist()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;char ch;<BR>&nbsp;&nbsp;&nbsp;&nbsp;linklist *head,*p;<BR>&nbsp;&nbsp;&nbsp;&nbsp;head=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ch=getchar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;while(ch!='$')<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p=(linklist*)malloc(sizeof(linklist));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p-&gt;data=ch;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p-&gt;next=head;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head=p;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch=getchar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;return(head);<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:shiguangling 回复日期:2003-11-10 15:51:34
<br>内容:谢谢2楼师兄的回答,可我的turbo c 打不开头文件,是怎么回事?<BR><BR>unable to open include file &#34;stdio.h&#34;;<BR><BR>unable to open include file &#34;malloc.h&#34;.<BR><BR>谢谢指教
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:简单秀逗 回复日期:2003-11-10 15:53:27
<br>内容:工作路径没有设对!常见容易犯的问题!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

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