hdu 2117 java 为什么是WA?
题目网址:【http://zhidao.baidu.com/new?word=hdu+2117&ie=GBK】代码:importjava.util.*;publiccla...
题目网址:【http://zhidao.baidu.com/new?word=hdu+2117&ie=GBK】
代码:
import java.util.*;
public class Main{
public static void main(String []args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
int n = in.nextInt();
int m = in.nextInt();
int num = 10;
int t = 0;
if(n == 1)
System.out.println("0");
for(int i=0;i<m;i++){
t = num / n;
num = num * 10 % n ;
}
System.out.println(t);
}
}
} 展开
代码:
import java.util.*;
public class Main{
public static void main(String []args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
int n = in.nextInt();
int m = in.nextInt();
int num = 10;
int t = 0;
if(n == 1)
System.out.println("0");
for(int i=0;i<m;i++){
t = num / n;
num = num * 10 % n ;
}
System.out.println(t);
}
}
} 展开
展开全部
import java.util.*;
public class 陵物局Main {
public static void main(String []args){ 蚂和
Scanner in = new Scanner(System.in);
while(in.hasNext()){
int n = in.nextInt();
int m = in.nextInt();
int num = 10;
int t = 0;
if(n == 1) {
System.out.println("0");
continue;
}
for(int i=0;i<m;i++){
t = num / n;
num = 尺让num % n * 10;
}
System.out.println(t);
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询