提出 #903937


ソースコード 拡げる

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;

char sa[200],sb[200],sc[200];
int main(){

  scanf("%s",sa);
  scanf("%s",sb);
  scanf("%s",sc);
  int alen=strlen(sa);
  int blen=strlen(sb);
  int clen=strlen(sc);
  int acur=0,bcur=0,ccur=0;

  char cha='a';
  while(1){
    if(alen==acur && cha=='a') {printf("A\n"); break;}
    if(blen==bcur && cha=='b') {printf("B\n"); break;}
    if(clen==ccur && cha=='c') {printf("C\n"); break;}

    if(cha=='a'){
      cha=sa[acur];
      acur+=1;
    }
    else if(cha=='b'){
      cha=sb[bcur];
      bcur+=1;
    }
    else if(cha=='c'){
      cha=sc[ccur];
      ccur+=1;
    }

  }


  return 0;

}

提出情報

提出日時
問題 B - 3人でカードゲームイージー
ユーザ yamaguchi1024
言語 C++14 (GCC 5.4.1)
得点 200
コード長 1131 Byte
結果 AC
実行時間 3 ms
メモリ 256 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:23:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",sa);
                 ^
./Main.cpp:24:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",sb);
                 ^
./Main.cpp:25:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",sc);
                 ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果 AC
AC × 10
セット名 テストケース
Sample
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt
ケース名 結果 実行時間 メモリ
01.txt AC 3 ms 256 KiB
02.txt AC 3 ms 256 KiB
03.txt AC 3 ms 256 KiB
04.txt AC 3 ms 256 KiB
05.txt AC 3 ms 256 KiB
06.txt AC 3 ms 256 KiB
07.txt AC 3 ms 256 KiB
08.txt AC 3 ms 256 KiB
09.txt AC 3 ms 256 KiB
10.txt AC 3 ms 256 KiB
sample_01.txt AC 3 ms 256 KiB
sample_02.txt AC 3 ms 256 KiB