
C语言
文章平均质量分 89
商商-77
Keep moving!!!
展开
-
超市出口问题
一.实验题目 有个超市要开业了(营业时间8-19点),据经验统计,每个客人来结账的时间服从随机分布,每个顾客需要服务的时间服从正态分布(均值为2分钟,方差为1分钟),超市平时的顾客较少(8-12点、14-17点),顾客来结账的平均人数为60人/小时,而高峰期(12-14,17-19点)平均人数为300人/小时,平常顾客等待时间超过3分钟则不满意,而高峰期等待5分钟则不满意,顾客总是排在队列长度最原创 2014-08-10 10:04:14 · 1129 阅读 · 0 评论 -
C语言产生随机数
rand产生随机数 #include"stdio.h" #include"stdlib.h" void main() { int i; for(i=0;i5;i++) printf("%d ",rand()%100); printf("\n"); } 650) this.width=650;" border="0" a原创 2014-08-10 10:04:37 · 494 阅读 · 0 评论 -
C语言计算任意数的任意次方
650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/attachment/201110/213306673.jpg" /> #include "stdio.h" #include"stdlib.h" #define max 500 void yiwei(int *a,int n,int m) {原创 2014-08-10 10:03:41 · 3494 阅读 · 0 评论 -
时间和日期函数
clock测定运行时间函数 #include"stdio.h" #include"time.h" #include"dos.h" #include "Windows.h" int main(void) { clock_t start,end; start=clock(); Sleep(1045); //delay(); end=c原创 2014-08-10 10:04:39 · 444 阅读 · 0 评论 -
C语言or和and运算
#include<stdio.h> voidmain() { printf("0|0is%d\n",0|0); printf("0|1is%d\n",0|1); printf("1|1is%d\n",1|1); printf("1|2is%d\n",1|2); ...原创 2014-08-10 10:07:34 · 15285 阅读 · 0 评论 -
中文和拼音自动转换的输入框
650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/attachment/201203/112505431.png" /> script type="text/vbscript"> Set d = CreateObject("Scripting.Dictionary") d.add "a",-20319 d.a转载 2014-08-10 10:06:36 · 930 阅读 · 0 评论 -
栈
#include"stdio.h" #include"malloc.h" typedef char datatype; typedef struct SeqStack { datatype elem[100]; int top; }SeqStack,*LinkList; void IniSeqStack(LinkList p) { p->top=-1;原创 2014-08-10 10:06:48 · 538 阅读 · 0 评论 -
数据结构队列的各种操作
#include"stdio.h" #include"stdlib.h" typedef int ElementType; typedef struct Queue { int rear,front; ElementType *elements; int MaxSize; }Queue; void InitQueue(Queue *Q,int sz)//初原创 2014-08-10 10:06:53 · 530 阅读 · 0 评论 -
C语言转换大小写
#include #include // Contains the tolower prototype void main (void) { int letter; for (letter = getchar(); ! feof(stdin); letter = getchar()) putchar(tolower(letter)); }原创 2014-08-10 10:07:36 · 872 阅读 · 0 评论 -
N个数全排列的非递归算法
//N个数全排列的非递归算法 #include"stdio.h" void swap(int &a, int &b) { int temp; temp = a; a = b; b = temp; } /* 根据当前的排列p,计算下一个排列。 原则是从1234–>4321,若p已经是最后一个排列,传回false,否则传回tr原创 2014-08-10 10:03:52 · 840 阅读 · 0 评论 -
C语言时间函数
#include "time.h" #include "stdio.h" #include "stdlib.h" int main() { system ("color b2"); time_t start,end; start = time(NULL); system("pause"); end = time(NULL); pr原创 2014-08-10 10:03:50 · 473 阅读 · 0 评论 -
数据结构队列的各种操作
#include"stdio.h" #include"stdlib.h" typedef int ElementType; typedef struct Queue { int rear,front; ElementType *elements; int MaxSize; }Queue; void InitQueue(Queue *Q,int sz)//初原创 2014-08-10 10:06:51 · 440 阅读 · 0 评论 -
百度之星--------图标排列
描述百度应用平台上有很多有趣的应用,每个应用都由一个开发者开发,每个开发者可能开发一个或多个应用。百度的工程师们想把应用尽可能好的推荐给用户。 研究发现,同一个开发者开发的程序的图标有很大的相似性。如果把同一个开发者开发的应用放在一起,用户很快就会厌倦相似的图标,如果把这些图标穿插摆放效果就会好很多。 现在工程师想给用户推荐来自m个开发者的n个应用,在推荐的时候这些应用的图标将原创 2014-08-10 10:03:54 · 498 阅读 · 0 评论 -
八皇后问题
#include "stdio.h" #define num 8 int a[num][num],count=0; FILE *fw; int judge() { int aa=0,bb=0; int i,j,num1=0; ////////////////横排不用判断 for (i=0;i//判断竖排 {原创 2014-08-10 10:04:12 · 450 阅读 · 0 评论 -
用C语言将搜狗输入法词库转换成QQ拼音输入法词库
搜狗输入法词库格式: 'ni'kan'xia 你看下 'ni'kan'xia'gai'hou 你看下改后 'ni'kan'xing'ma 你看行吗 'ni'kan'zen'me'yang 你看怎么样 'ni'kan'zhe 你看着 'ni'kan'zhe'ban 你看着办 'ni'kan'zhe'jiu'xing 你看着就行 'ni'kao'bu'kao 你考不考原创 2014-08-10 10:03:20 · 1156 阅读 · 0 评论 -
C语言绘制余弦函数图象
#include"stdio.h" #include"math.h" void main() { double y; int x,m; for(y=1;y>=-1;y-=0.1) { m=acos(y)*10; for(x=1;x printf(" "); printf("*"原创 2014-08-10 10:04:25 · 1279 阅读 · 0 评论 -
取三个数字最大值
int getMax(a,b,c) { return a>b?(a>c?a:c):(b>c?b:c); }转载 2014-08-10 10:04:43 · 788 阅读 · 0 评论 -
从文件中查找关键字算法
// (1)源文件为一个txt文档,内容为符号串; // (2)给定一个关键字文件,内容为自定义的关键字(注:关键字有若干个,用空格隔开); // (3)依据关键字文件中的关键字在源文件中进行检索判断,得到关键字 #include"stdio.h" #include"string.h" #include"malloc.h" #define BUFLEN 20480 #define M原创 2014-08-10 10:04:45 · 933 阅读 · 0 评论 -
链表的输入与输出
#include"stdio.h" #include"malloc.h" typedef struct Node { char data; struct Node *next; }Node,*Linklist; void Input(Linklist &p)//输入函数 { Node *r,*s; r=p; char c; int fl原创 2014-08-10 10:06:46 · 1031 阅读 · 0 评论 -
C语言二维数组中的指针问题
#include "stdio.h" void main() { int a[5][5]; int i,j; for (i=0;i<5;i++) { for (j=0;j<5;j++) { a[i][j] =i; } } for (i=0;i<5原创 2014-08-10 10:08:43 · 574 阅读 · 0 评论