上一页 1 ··· 30 31 32 33 34

2013年8月3日

POJ 1316 Self Numbers

摘要: POJ 1316 Self Numbershttp://poj.org/problem?id=131633, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, ...39=33+3+3;51=39+3+9;57=51+5+1;输出1-10000的不具有这种规律的数。 1 # include 2 int a[10011]={0}; 3 void self(int i) 4 { 5 int flag=i; 6 while(i) 7 { 8 flag+=i%10; 9 i=i/10;1... 阅读全文

posted @ 2013-08-03 10:16 随风浪子的博客 阅读(95) 评论(0) 推荐(0) 编辑

POJ 2499 Binary Tree

摘要: http://poj.org/problem?id=2499题意:从(1,1)开始向左走为(2,1),向右走为(1,2)规律是 (m,n)向左走为(m+n,n),向右走为(m,n+m)求 要走到所给坐标 需要向左走多少步,向右走多少步;思路:手写几步找下规律逆向思维,从(m,n)到(1,1)。给定(m,n),求其上一坐标,如果m>n,则上一坐标是(m-n,n),否则(m,n-m)。 1 # include 2 int main() 3 { 4 int n,m,t; 5 int left,right,i=1; 6 scanf("%d",&t); 7 while( 阅读全文

posted @ 2013-08-03 09:19 随风浪子的博客 阅读(101) 评论(0) 推荐(0) 编辑

2013年8月2日

POJ 3006 找给定的一叙述找第n个素数

摘要: 1 # include 2 # include 3 int judge(int n) 4 { 5 int i,j,leag=1; 6 if(n==0 || n==1) 7 leag=0; 8 else 9 {10 if(n==2)11 leag=1;12 else13 for(i=2;i<=sqrt(n);i++)14 if(n%i == 0)15 {16 l... 阅读全文

posted @ 2013-08-02 15:36 随风浪子的博客 阅读(92) 评论(0) 推荐(0) 编辑

上一页 1 ··· 30 31 32 33 34

导航