会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Min.A.Slintre
博客园
首页
新随笔
联系
订阅
管理
2015年7月
辗转相除法求余数
摘要: #include int gcd(int a,int b){ if(a%b==0) return b; else return gcd(b,a%b);}int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",gcd(a,b)...
阅读全文
posted @ 2015-07-31 15:12 Min.A.Slintre
阅读(267)
评论(0)
推荐(0)
2015年2月
输出一个整数内的所有质数
摘要: #include#includeint main(){ int n,i,t,j; scanf("%d",&n); if(nt) printf("%d\n",j); } } return 0;}
阅读全文
posted @ 2015-02-04 11:53 Min.A.Slintre
阅读(222)
评论(0)
推荐(0)
Fibonacci数列
摘要: Fibonacci数列后一项等于前两项只和,即整个数列为 1,1,2,3,5,8,13,21,34,55······#includeint main(){ int a=1,b=1,c,n,i; scanf("%d",&n); if(n==1||n==2) { printf("1\n");...
阅读全文
posted @ 2015-02-04 11:53 Min.A.Slintre
阅读(178)
评论(0)
推荐(0)
2014年12月
判断一个数是否是质数
摘要: #includeint main(){ int i,n; scanf("%d",&n); if(n#include //在这里,我们需要用到math来使用数学符号int main(){ int i,n,t; scanf("%d",&n); t=sqrt(n); //sqr...
阅读全文
posted @ 2014-12-03 17:14 Min.A.Slintre
阅读(200)
评论(0)
推荐(0)
2014年11月
比较最大最小值并输出
摘要: #includeint main(){ int n,i,x,max,min; //n为输入整数的个数,x为输入的整数 scanf("%d\n%d",&n,&x); max=x; min=x; //首先令最大值和最小值都等于输入的第一个值 for(i=2;i...
阅读全文
posted @ 2014-11-24 17:28 Min.A.Slintre
阅读(153)
评论(0)
推荐(0)
公告