結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
tntan
|
| 提出日時 | 2015-12-15 14:04:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 697 bytes |
| コンパイル時間 | 825 ms |
| コンパイル使用メモリ | 70,584 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 11:37:20 |
| 合計ジャッジ時間 | 2,168 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include<iostream>
#include<string>
#include<fstream>
#include<iomanip>
#include<vector>
#include<cctype>
#include<algorithm>
#include<sstream>
using namespace std;
int main()
{
string s, t;
cin >> s >> t;
int a = static_cast<int>(s.size()), b = static_cast<int>(t.size());
if (a > b)cout << s << endl;
else if (a < b)cout << t << endl;
else
{
for (int i = 0; i < a; i++)
{
if (s[i] == t[i])continue;
else
{
if (s[i] == '4'&&t[i] == '7')
{
cout << s << endl;
}
else if (s[i] == '7'&&t[i] == '4')
{
cout << t << endl;
}
else
{
if (s[i]>t[i])cout << s << endl;
else cout << t << endl;
}
break;
}
}
}
return 0;
}
tntan