摘要: #include<stdio.h>#define Max 100int input(int *in,int *out){ int a,b; printf("请输入来访时间和离开时间\n"); printf("范例:1\t\t3\n"); printf("餐会结束时请输入-1结束\n"); int c 阅读全文
posted @ 2016-05-08 20:23 薄樱 阅读(402) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>bool IsArmstrong(int a){ int x,y,z,sum; x=a/100; y=(a-100*x)/10; z=(a-100*x-10*y); sum=x*x*x+y*y*y+z*z*z; if(sum==a) return true; els 阅读全文
posted @ 2016-05-08 20:20 薄樱 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 初次接触递归的思想,折腾了一天多,本想自己把算法写出来的,但是最后还是看的书上的代码,发现原来这么简单,真是自惭形秽,下面是书上的代码 #include <iostream> using namespace std; #define N 8 bool matrix[N + 1][N + 1] = { 阅读全文
posted @ 2016-05-08 20:19 薄樱 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 这个是看书上面的一段代码: #include <stdio.h>void swap(int x,int y,char *p){ char temp; temp=p[x]; p[x]=p[y]; p[y]=temp;}void output(char *p,int size){ printf("修整后 阅读全文
posted @ 2016-05-08 19:43 薄樱 阅读(827) 评论(0) 推荐(0) 编辑
摘要: #include <ctime>#include <cstdlib>#include<stdio.h>int TimeRand()//根据系统时间随机取1-6中的数字{ int t; //seed srand((unsigned)time(NULL)); t = rand() % 6+ 1; // 阅读全文
posted @ 2016-05-08 19:37 薄樱 阅读(369) 评论(0) 推荐(0) 编辑