<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[千年一梦]]></title>
<link>http://blog.pfan.cn/zhaoxn04</link>
<description>编程爱好者博客</description>
<language>zh-cn</language>
			<item>
		<title><![CDATA[matlab实用程序百例1]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30108.html</link>
		<description><![CDATA[1-32是：图形应用篇
33-66是：界面设计篇
67-84是：图形处理篇
85-100是：数值分析篇
&nbsp;
实例1：三角函数曲线（1）
function shili01h0=figure('toolbar','none',...&nbsp;&nbsp;&nbsp; 'position',[198 56 350 300],...&nbsp;&nbsp;&nbsp; 'name','实例01');h1=axes('parent',h0,...&nbsp;&nbsp; 'visible','off');x=-pi:0.05:pi;y=sin(x);plot(x,y);xlabel('自变量X');ylabel('函数值Y');title('SIN( )函数曲线');grid on
实例2：三角函数曲线（2）
function shili02h0=figure('toolbar','none',...&nbsp;&nbsp;&nbsp; 'position',[200 150 450 350],...&nbsp;&nbsp;&nbsp; 'name','实例02');x=-pi:0.05:pi;y=sin(x)+cos(x);plot(x,y,'-*r','linewidth',1);grid onxlabel('自变量X');ylabel('函数值Y');title('三角函数');
实例3：图形的叠加
function shili03h0=figure('toolbar','none',...&nbsp;&nbsp;&nbsp; 'position',[200 150 450 350],...&nbsp;&nbsp;&nbsp; 'name','实例03');x=-pi:0.05:pi;y1=sin(x);y2=cos(x);plot(x,y1,...&nbsp;&nbsp;&nbsp; '-*r',...&nbsp;&nbsp;&nbsp; x,y2,...&nbsp;&nbsp;&nbsp; '--og');grid onxlabel('自变量X');ylabel('函数值Y');title('三角函数');
实例4：双y轴图形的绘制
function shili04h0=figure('toolbar','none',...&nb]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 13:07:00</pubDate>
		</item>
				<item>
		<title><![CDATA[用matlab做的一个日历]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30107.html</link>
		<description><![CDATA[function CalendarTable; % calendar 日历 % Example: %&nbsp;&nbsp;&nbsp; CalendarTable; 
S=datestr(now); [y,m,d]=datevec(S); % d is day % m is month % y is year DD={'Sun','Mon','Tue','Wed','Thu','Fri','Sat'}; close all figure; for k=1:7; &nbsp;&nbsp; uicontrol(gcf,'style','text',... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'unit','normalized','position',[0.02+k*0.1,0.55,0.08,0.06],... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'BackgroundColor',0.6*[1,1,1],'ForegroundColor','b',... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'String',DD(k),'fontsize',16,'fontname','times new roman'); end h=1; ss='b'; qq=eomday(y,m); for k=1:qq; &nbsp;&nbsp; n=datenum(y,m,k); &nbsp;&nbsp; [da,w] = weekday(n); &nbsp;&nbsp; if k==d; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss='r'; &nbsp;&nbsp; end &nbsp;&nbsp; uicontrol(gcf,'style','push',... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'unit','normalized','position',[0.02+da*0.1,0.55-h*0.08,0.08,0.06],... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'BackgroundColor',0.6*[1,1,1],'ForegroundCol]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 13:04:00</pubDate>
		</item>
				<item>
		<title><![CDATA[字符串排序]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30106.html</link>
		<description><![CDATA[输入一组字符串，请你将它们按字典序输出。
此题由多组输入，每组输入的格式如下： n string1 string2 . . . stringn 其中0&lt;=n&lt;=100,任何一个字符串的长度不会超过100，字符串中只含有小写英文字母。当n=0时，程序即可结束。
#include "stdafx.h"#include &lt;iostream&gt;using namespace std;int main(){int n;char aa[101][101];char pp[101];cin&gt;&gt;n;while(n!=0){for(int i1=0;i1&lt;n;i1++)cin&gt;&gt;aa[i1];
for(int i2=0;i2&lt;n;i2++){if(strcmp(aa[i2], aa[i2+1]) &gt;= 0){strcpy(pp,aa[i2]);strcpy(aa[i2],aa[i2+1]);strcpy(aa[i2+1],pp);}}cout&lt;&lt;n&lt;&lt;endl;for(int i3=0;i3&lt;n;i3++)cout&lt;&lt;aa[i3]&lt;&lt;endl;cin&gt;&gt;n;}return 0;}
运行结果正确，但是也是超时！还没想到更好的办法提高效率！]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 13:02:00</pubDate>
		</item>
				<item>
		<title><![CDATA[水仙花数]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30105.html</link>
		<description><![CDATA[所谓“水仙花数”是指一个三位数，其各位数字立方和等于该数本身。例如：153是一个“水仙花数”，因为153=13+53+33。本题要求打印出所有的水仙花数。#include "iostream.h"
int main()
{int i,n,j,k;
  for(n=100;n&lt;1000;n++)
  {i=n/100;
   j=n/10-i*10;
   k=n%10;
   if(n==i*i*i+j*j*j+k*k*k)
	   cout&lt;&lt;n&lt;&lt;" " ;
  }
  cout&lt;&lt;endl;
	return 0;
}]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 12:59:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Sorting&nbsp;by&nbsp;Swapping]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30104.html</link>
		<description><![CDATA[题目：Given a permutation of numbers from 1 to n, we can always get the sequence 1, 2, 3, ..., n by swapping pairs of numbers. For example, if the initial sequence is 2, 3, 5, 4, 1, we can sort them in the following way: 2 3 5 4 1 1 3 5 4 2 1 3 2 4 5 1 2 3 4 5 Here three swaps have been used. The problem is, given a specific permutation, how many swaps we needs to take at least. 我写的程序：
#include "stdafx.h"#include &lt;iostream&gt;using namespace std;int main(){int n,i=1,j,m,count,temp;int s[10001];cin&gt;&gt;n;for(;n!=0;n--){ cin&gt;&gt;m;&nbsp; count=0;&nbsp;&nbsp; for(j=1;j&lt;=m;j++)&nbsp;&nbsp;&nbsp;&nbsp; cin&gt;&gt;s[j];&nbsp;&nbsp; for(i=1;i&lt;=m;i++)&nbsp;&nbsp;&nbsp; while(s[i]!=i)&nbsp;&nbsp; {j=s[i];temp=s[i];s[i]=s[j];s[j]=temp;count++;}&nbsp;&nbsp; cout&lt;&lt;count&lt;&lt;endl;}return 0;}
运行结果虽然正确，但是老超时，效率不高！在网上看到别人的程序，效率要提高很多：
#include&lt;stdio.h&gt;int main(){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int n,m,i,j,k,t;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short p[10]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 12:58:00</pubDate>
		</item>
				<item>
		<title><![CDATA[N!末尾一共有多少个0]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30103.html</link>
		<description><![CDATA[#include "stdafx.h"#include &lt;iostream&gt;#include &lt;math.h&gt;using namespace std;int main(){int n,i;cin&gt;&gt;n;while(n){i=n/5+n/25+n/125+n/625;cout&lt;&lt;i&lt;&lt;endl;cin&gt;&gt;n;}return 0;}]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 12:54:00</pubDate>
		</item>
				<item>
		<title><![CDATA[学生成绩管理系统]]></title>
		<link>http://blog.pfan.cn/zhaoxn04/30102.html</link>
		<description><![CDATA[#include &lt;stdio.h&gt;#include &lt;mem.h&gt;#include &lt;stdlib.h&gt;#include &lt;dos.h&gt;#include &lt;ctype.h&gt;#include &lt;alloc.h&gt;#include &lt;string.h&gt;#define LEN sizeof(struct student)struct student{char num[6];&nbsp;char name[6];&nbsp;int score[3];&nbsp;int sum;&nbsp;float average;&nbsp;int order;&nbsp;struct student *next;}head;int select(){int n;printf("********************************Welcome**************************************\n");printf("These below are your choices:\n");printf("\t\t1:Creat a text.\n");printf("\t\t2:Show the contents of the text.\n");printf("\t\t3:Search what you want in the system.\n");printf("\t\t4:Delete what you do not want to reserve.\n");printf("\t\t5:Insert the dates you insert.\n");printf("\t\t6:Sort these dates.\n");printf("\t\t7:Save these dates you insert.\n");printf("\t\t8:Load the dates from the file.\n");printf("\t\t9:Quit.\n");printf("********************************END*******************************************\n");printf("\t\tPle]]></description>
		<author><![CDATA[zhaoxn04]]></author>
		<pubDate>2007-10-14 12:50:00</pubDate>
		</item>
		</channel>
</rss>