結果
| 問題 | No.536 人工知能 |
| コンテスト | |
| ユーザー |
Elk
|
| 提出日時 | 2018-05-28 23:53:31 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 558 bytes |
| 記録 | |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 40,356 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-20 02:42:38 |
| 合計ジャッジ時間 | 762 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function 'int check_abc_pos(char)':
main.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type]
14 | }
| ^
ソースコード
#include <stdio.h>
#include <string.h>
char ABC[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int check_abc_pos(char a){
char c;
for(c = 'a'; c <= 'z'; c++){
if(c == a){
return (c - 'a');
}
}
}
int main(){
char id[20], str[20];
int len;
scanf("%s", id);
len = strlen(id);
if(id[len - 2] == 'a' && id[len - 1] == 'i'){
id[len - 2] = 'A';
id[len - 1] = 'I';
printf("%s\n", id);
}else{
sprintf(str, "%s%s", id, "-AI");
printf("%s\n", str);
}
return 0;
}
Elk