2016年8月28日
摘要: #include<stdio.h>int a[100],b[100]={0},m,n;bool p(int k)//定义一个bool类型函数 ,用来判断 { if(b[k]==1) { return false; } return true;}void s(int k)//定义一个函数,用来回溯; 阅读全文
posted @ 2016-08-28 15:36 xuehua11 阅读(169) 评论(0) 推荐(0) 编辑
  2016年7月7日
摘要: #include<stdio.h>int b[11]={0,1,2,3,4,5,6,12,13,18,19},n;int zhd(int x,int y){ int z; if(x<=y) { z=(x+y)/2; if(b[z]==n) return z; if(b[z]<n) return zh 阅读全文
posted @ 2016-07-07 20:24 xuehua11 阅读(113) 评论(1) 推荐(1) 编辑
摘要: #include<stdio.h>int main(){ int i; for(i=1;1<=i;i++) printf("%d",i); return 0;} 阅读全文
posted @ 2016-07-07 17:23 xuehua11 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>void hanoi(int n,char A,char B,char C){ if(n==1) { printf("%c-->%c\n",A,C); printf("%c-->%c\n",A,C); } else { hanoi(n-1,A,C,B); print 阅读全文
posted @ 2016-07-07 17:21 xuehua11 阅读(170) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>void hanoi(int n,char A,char B,char C){ if(n==1) printf("%c-->%c\n",A,C); else { hanoi(n-1,A,C,B); printf("%c-->%c\n",A,C); hanoi(n-1 阅读全文
posted @ 2016-07-07 17:20 xuehua11 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int n;int zhd(int n){ if(n<10) return n; else return zhd(n%10); }int main(){ int n; scanf("%d",&n); while(n!=0) { printf("%d",zhd(n)) 阅读全文
posted @ 2016-07-07 17:18 xuehua11 阅读(802) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int zhd(int n){ if(n==1||n==2) return 1; else return zhd(n-1)+zhd(n-2); }int main(){ int n; scanf("%d",&n); printf("%d",zhd(n)); retu 阅读全文
posted @ 2016-07-07 17:17 xuehua11 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int n;void zhd(double a[10000]){ scanf("%d",&n); for(int i=0;i<=n-1;i++) { scanf("%lf",&a[i]); }}int main(){ double b[10000]; zhd(b); 阅读全文
posted @ 2016-07-07 11:13 xuehua11 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 判断:#include<stdio.h>int prime(int x){ int i; for(i=2;i<=x;i++) { if(x%i==0) break; } if(i==x) printf("true"); else printf("false"); return i; }int mai 阅读全文
posted @ 2016-07-07 11:11 xuehua11 阅读(236) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h>int min(int x,int y,int z){ int s=0; if(x>y) s=y; else s=x; if(s>z) s=z; return s;}int main(){ int a,b,c,d; scanf("%d %d %d",&a,&b,&c 阅读全文
posted @ 2016-07-07 11:10 xuehua11 阅读(112) 评论(0) 推荐(0) 编辑