摘要: 我知道,在许多人看来这是一道简单题,但说实话,这道题确实费了不少时间和精力!提交了很多次,补充了很多的知识点,比如尝试着去用随机数创建测试数据,用gdb调试,学着用文件输入输出,然后用dos比对文件的不同!View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int isrui( int y ) 5 { 6 if( !(y%100) ) 7 { 8 if( !(y%400) ) 9 return 1;10 }11 else if( !(y%4) )12 ... 阅读全文
posted @ 2013-03-07 15:07 翼展zjz 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 这是杭电上的一道简单题,我很意外我的代码可以AC,我以为这样写会超时! 本来是想建立一个表,通过查表的形式我觉得效率会更高一些,可是在建表的过程中,表中的数据实在难搞(也可能是我没发现规律),建表问题暂且搁置!View Code #include <stdio.h>#include <stdlib.h>int counter( int n ){ int cnt = 1; while( n != 1 ) { if( !(n%2) ) { n = n/2; cnt++; ... 阅读全文
posted @ 2013-02-25 10:08 翼展zjz 阅读(125) 评论(0) 推荐(0) 编辑