結果

問題 No.908 うしたぷにきあくん文字列
ユーザー ks2m
提出日時 2019-10-18 21:22:18
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 3,040 ms
コンパイル使用メモリ 74,340 KB
実行使用メモリ 54,356 KB
最終ジャッジ日時 2024-06-25 14:44:56
合計ジャッジ時間 6,316 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		for (int i = 0; i < s.length(); i++) {
			if (i % 2 == 1) {
				if (s.charAt(i) != ' ') {
					System.out.println("No");
					return;
				}
			} else {
				if (s.charAt(i) == ' ') {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}
0