結果

問題 No.495 (^^*) Easy
ユーザー HEGO55HEGO55
提出日時 2017-05-10 16:00:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 73,536 KB
実行使用メモリ 58,760 KB
最終ジャッジ日時 2023-10-13 10:02:26
合計ジャッジ時間 3,990 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 145 ms
56,588 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class Test32{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int right = 0;
		int left = 0;
		String str = sc.next();
		
		for(int i=1; i<=(str.length()-1)/5; i++){
			if(str.charAt((2+(i-1)*5)-1) == '*'){
				right++;
			}else if(str.charAt((4+(i-1)*5)-1) == '*'){
				left++;
			}
	    }
		System.out.println(right+" "+left);
	}
}
0