結果
| 問題 | No.293 4>7の世界 |
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-07-09 09:27:14 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 544 bytes |
| 記録 | |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 39,552 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-04 02:18:54 |
| 合計ジャッジ時間 | 1,184 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
ソースコード
#include<stdio.h>
#include<string.h>
main(){
char A[11],B[11];
scanf("%s %s",A,B);
if(strlen(A) != strlen(B)){
printf("%s\n",strlen(A)>strlen(B) ? A:B);
}else{
for(int i = 0;i < strlen(A);i++){
if(A[i] == B[i]){continue;}
if(A[i] == '4' && B[i] == '7'){
printf("%s\n",A);
}else if(A[i] == '7' && B[i] == '4'){
printf("%s\n",B);
}else{
printf("%s\n",A[i]>B[i]?A:B);
}
break;
}
}
}
Bantako