Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e6a859

Browse files
authored
Merge pull requestTheAlgorithms#374 from GammaBurst101/Fix-error
Fix a logical error and set a method to private
2 parents81d3e9b +f1200c0 commit4e6a859

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Others/countwords.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public static void main(String[] args){
1818
input.close();
1919
}
2020

21-
publicstaticintwordCount(Strings){
22-
if(s.isEmpty() ||s ==null)return-1;
21+
privatestaticintwordCount(Strings){
22+
if(s.isEmpty() ||s ==null)return0;
2323
returns.trim().split("[\\s]+").length;
2424
}
2525

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp