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_20786201_3149.cpp:1:1: error: 'publicclassFindString' does not name a type
 publicclassFindString{/***fileName要查找的文本,str要查找的字符串**/publicintfindString(StringfileName,Stringstr){intcount=0;try{intline=0;//记录行数BufferedReaderbr=newBufferedReader(newFileReader(fileName));Stringtmp=br.readLine();while(tmp!=null){line++;intindex=tmp.indexOf(str,0);while(index>=0){count++;System.out.println("在"+line+"行,第"+index+"列,找到字符:"+str);index=tmp.indexOf(str,index+str.length());}tmp=br.readLine();}br.close();}catch(FileNotFoundExceptione){e.printStackTrace();}catch(IOExceptione){e.printStackTrace();}returncount;}}
 ^


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-12-11 00:13:58, Gzip enabled