結果
問題 | No.495 (^^*) Easy |
ユーザー |
![]() |
提出日時 | 2017-04-09 19:00:21 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 196 ms / 2,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 2,301 ms |
コンパイル使用メモリ | 76,228 KB |
実行使用メモリ | 55,348 KB |
最終ジャッジ日時 | 2024-07-18 01:36:07 |
合計ジャッジ時間 | 3,579 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
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] == '*') { if (emoticons[i + 1] == ')') { countLeft ++; } else if (emoticons[i + 1] == '^'){ countRight ++; } } } System.out.println(countLeft + " " + countRight); } }