F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_31907979_27806\Main.java:1: 错误: 类P2031是公共的, 应在名为 P2031.java 的文件中声明
import java.util.Scanner;public class P2031 {	public static void main(String[] args) {	  Scanner sc=new Scanner(System.in);	  while(sc.hasNext()){		  int n=sc.nextInt();		  int r=sc.nextInt();		  char a[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};		  if(r<2&&r>16){			  break;		  }		  int p=0;		  if(n<0){			  n=-n;			  p=-1;		  }		  int x,y,i=0;		  String str[]=new String[100];			  while(n>0){			  x=n%r;              str[i]=a[x]+"";              i++;              n=n/r;              }           if(p==-1){			  System.out.print("-");		  }		for(int j=i-1;j>=0;j--){			System.out.print(str[j]);		}		  System.out.println();	  }	}}
                                ^
1 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-16 10:36:16, Gzip enabled