結果

問題 No.495 (^^*) Easy
ユーザー samplelpmas
提出日時 2017-04-09 18:57:15
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 550 bytes
コンパイル時間 2,610 ms
コンパイル使用メモリ 76,632 KB
実行使用メモリ 54,784 KB
最終ジャッジ日時 2024-07-18 01:36:02
合計ジャッジ時間 3,336 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 7
権限があれば一括ダウンロードができます

ソースコード

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