結果

問題 No.495 (^^*) Easy
ユーザー samplelpmassamplelpmas
提出日時 2017-04-09 18:57:15
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 550 bytes
コンパイル時間 2,661 ms
コンパイル使用メモリ 73,608 KB
実行使用メモリ 57,724 KB
最終ジャッジ日時 2023-09-25 01:27:57
合計ジャッジ時間 4,325 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        char[] emoticons = sc.next().toCharArray();

        int countLeft = 0;
        int countRight = 0;

        for (int i = 0; i < emoticons.length; i++) {

            if (emoticons[i + 1] == ')') {
                countLeft ++;
            } else if (emoticons[i + 1] == '^'){
                countRight ++;
            }

        }

        System.out.println(countLeft + " " + countRight);

    }

}
0