dota2吧 关注:6,287,376贴子:175,495,676
  • 3回复贴,共1

各位大神帮我看看哪里有问题

只看楼主收藏回复

import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
while(in.hasNext()){
int s=in.nextInt();
if(s==0)break;
for(int i=0;i<=s;i++){
int n=in.nextInt();
int m=in.nextInt();
int a=0;
while(true){
a++;
if(n/Math.pow(m, a)%m!=0)
{System.out.print(a);break;}
}
}
}
}
}


IP属地:上海来自Android客户端1楼2016-03-26 14:01回复
    下面是错误提示


    IP属地:上海来自Android客户端2楼2016-03-26 14:01
    回复
      Exception in thread "main" java.util.NoSuchElementException
      at java.util.Scanner.throwFor(Scanner.java:855)
      at java.util.Scanner.next(Scanner.java:1478)
      at java.util.Scanner.nextInt(Scanner.java:2108)
      at java.util.Scanner.nextInt(Scanner.java:2067)
      at Main.main(Main.java:16)


      IP属地:上海来自Android客户端3楼2016-03-26 14:01
      回复
        大神们求救啊


        IP属地:上海来自Android客户端5楼2016-03-26 14:03
        回复