
编程之美
勇哥聊IT
分享编程心得,共赏技术风景
展开
-
编程之美-1的数目 解法及性能比较
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.logging.Handler; import javax.swing.text.StyledEditorKit.原创 2012-07-06 17:18:31 · 485 阅读 · 0 评论 -
编程之美---1的个数 C++实现
方法1 #include "stdafx.h" #include #include using namespace std; int count(int n){ int result=0; while(n!=0){ if(n%10==1) result++; n/=10; } return result; } int total(int n){ int sum转载 2013-02-26 14:53:30 · 1057 阅读 · 0 评论