﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-C++永不止步-文章分类-操作系统原理</title><link>http://www.cppblog.com/AheadObjectOriented/category/18879.html</link><description>Come Back To Code</description><language>zh-cn</language><lastBuildDate>Tue, 27 Mar 2012 22:18:29 GMT</lastBuildDate><pubDate>Tue, 27 Mar 2012 22:18:29 GMT</pubDate><ttl>60</ttl><item><title>C语言程序：用命令行调用程序 实现简单的统计</title><link>http://www.cppblog.com/AheadObjectOriented/articles/168818.html</link><dc:creator>回归</dc:creator><author>回归</author><pubDate>Sat, 24 Mar 2012 11:14:00 GMT</pubDate><guid>http://www.cppblog.com/AheadObjectOriented/articles/168818.html</guid><wfw:comment>http://www.cppblog.com/AheadObjectOriented/comments/168818.html</wfw:comment><comments>http://www.cppblog.com/AheadObjectOriented/articles/168818.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/AheadObjectOriented/comments/commentRss/168818.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/AheadObjectOriented/services/trackbacks/168818.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">stdio.h</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #0000ff">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">stdlib.h</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;argc,</span><span style="color: #0000ff">char</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;argv[])<br />{<br /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;sum</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">;<br /></span><span style="color: #0000ff">if</span><span style="color: #000000">(argc</span><span style="color: #000000">&gt;</span><span style="color: #000000">1</span><span style="color: #000000">)<br />{<br /></span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">argc;</span><span style="color: #000000">++</span><span style="color: #000000">i)<br />sum</span><span style="color: #000000">+=</span><span style="color: #000000">atoi(argv[i]);<br />printf(</span><span style="color: #000000">"</span><span style="color: #000000">sum=%d\naverage=%lf\n</span><span style="color: #000000">"</span><span style="color: #000000">,sum,(</span><span style="color: #0000ff">double</span><span style="color: #000000">)sum</span><span style="color: #000000">/</span><span style="color: #000000">(argc</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">));<br />}<br /></span><span style="color: #0000ff">else</span><span style="color: #000000"><br />printf(</span><span style="color: #000000">"</span><span style="color: #000000">命令使用错误</span><span style="color: #000000">"</span><span style="color: #000000">);<br /></span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br />}</span></div><br /><img src ="http://www.cppblog.com/AheadObjectOriented/aggbug/168818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/AheadObjectOriented/" target="_blank">回归</a> 2012-03-24 19:14 <a href="http://www.cppblog.com/AheadObjectOriented/articles/168818.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>