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
阅读(118)
推荐(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
阅读(196)
推荐(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
阅读(176)
推荐(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
阅读(89)
推荐(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
阅读(840)
推荐(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
阅读(109)
推荐(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
阅读(118)
推荐(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
阅读(256)
推荐(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
阅读(116)
推荐(0)