JAVA程序设计题,在Program和End之间补充。求大神!!

已知一个int类型的数组,数组元素分别是{34,56,78,89,90,100},编写程序去除数组元素的十位数(使用for循环和除法运算)并输出。publicclassP... 已知一个int类型的数组,数组元素分别是{34,56,78,89,90,100},编写程序去除数组元素的十位数(使用for循环和除法运算)并输出。

public class Prog1{
/***********Program************/

/**********End**************/
}
展开
 我来答
小丑Delta
推荐于2016-10-11 · 超过20用户采纳过TA的回答
知道答主
回答量:48
采纳率:100%
帮助的人:27.8万
展开全部

public class Prog1 {

public static void main(String arg[]){
int temp1=0;
int temp2=0;
int temp3=0;
int count=0;
int ar[]={34,56,78,89,90,100};
for(int i=0;i<ar.length;i++){
count=0;
temp3=0;
temp1=ar[i];
while(temp1>0){
temp2=temp1%10;
if(count!=1){
if(count>1) count--;
temp3=(int)(temp3+temp2*Math.pow(10,count));
}
count++;
temp1=temp1/10;

}
System.out.print(temp3+" ");
}
}
}
姑苏访梦0K2
2015-06-20 · TA获得超过214个赞
知道小有建树答主
回答量:1913
采纳率:0%
帮助的人:401万
展开全部
快速,原创,网上绝对没有,给你。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式