求1到一个数n中所有1的个数。 public int PlusInt(int n){ int i,j,c=0; for(i=1;i<=n;i++){ j=i; while(j!=0){ if(j==1){ c++ } j=j/10; } } }