public class numbercount//此程序怎么查到0~9的每个个数的呢?
{public static void main(String args[])
{
int num[]=new int [30],m;
int sam[]={3,1,5,7,2,4,0,6,9,4,1,5,8,2,3,4,5,3,0,2};
int s=sam.length;
for(m=0;m<s;m++)
{
int n;
num[sam[m]]++;//换成下面的也不懂
/*n = sam[m];
num[n]++;*/ //什么意思,怎么执行的,看不明白它的意思
}
System.out.println("0 1 2 3 4 5 6 7 8 9");
for(m=0;m<10;m++)
System.out.print(num[m]+" ");
}
}
{public static void main(String args[])
{
int num[]=new int [30],m;
int sam[]={3,1,5,7,2,4,0,6,9,4,1,5,8,2,3,4,5,3,0,2};
int s=sam.length;
for(m=0;m<s;m++)
{
int n;
num[sam[m]]++;//换成下面的也不懂
/*n = sam[m];
num[n]++;*/ //什么意思,怎么执行的,看不明白它的意思
}
System.out.println("0 1 2 3 4 5 6 7 8 9");
for(m=0;m<10;m++)
System.out.print(num[m]+" ");
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货