結果
問題 | No.495 (^^*) Easy |
ユーザー |
![]() |
提出日時 | 2017-04-21 15:55:32 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 195 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 3,148 ms |
コンパイル使用メモリ | 76,180 KB |
実行使用メモリ | 43,344 KB |
最終ジャッジ日時 | 2024-07-20 05:03:03 |
合計ジャッジ時間 | 4,764 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
import java.util.Scanner; public class kaomoji { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); char[] emotions = sc.next().toCharArray(); int CountLeft = 0; int CountRight = 0; for(int i=0; i<emotions.length; i++ ){ if(emotions[i] == '*'){ if(emotions[i+1] == ')'){ CountLeft++; }else if(emotions[i+1] == '^'){ CountRight++; } } } System.out.println(CountLeft + " " + CountRight); } }