結果
| 問題 | 
                            No.201 yukicoderじゃんけん
                             | 
                    
| コンテスト | |
| ユーザー | 
                             teru__san
                         | 
                    
| 提出日時 | 2015-05-04 00:16:41 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 569 bytes | 
| コンパイル時間 | 94 ms | 
| コンパイル使用メモリ | 22,400 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-05 18:07:06 | 
| 合計ジャッジ時間 | 661 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 20 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%s %d %s", SA, &PA, XA);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%s %d %s", SB, &PB, XB);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(){
	char SA[101], SB[101];
	int PA, PB;
	char XA[2], XB[2];
	char win[101];
	scanf("%s %d %s", SA, &PA, XA);
	scanf("%s %d %s", SB, &PB, XB);
	if (PA < PB){ win[101] = SA[101]; }
	else if (PA>PB){ win[101] = SB[101]; }
	else{
		if ((*XA == 'R' && *XB == 'S') || (*XA == 'S'&&*XB == 'P') || (*XA == 'P'&&*XB == 'R'))
		{
			win[101] = SA[101];
		}
		else if ((*XA == 'R' && *XB == 'R') || (*XA == 'S'&&*XB == 'S') || (*XA == 'P'&&*XB == 'P'))
		{
			win[101] = -1;
		}
		else { win[101] = SB[101]; }
	}
	printf("%s", win);
	return 0;
}
            
            
            
        
            
teru__san