結果
| 問題 | No.293 4>7の世界 | 
| コンテスト | |
| ユーザー |  dgd1724 | 
| 提出日時 | 2016-11-01 07:02:36 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 786 bytes | 
| コンパイル時間 | 3,779 ms | 
| コンパイル使用メモリ | 158,184 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-30 12:18:01 | 
| 合計ジャッジ時間 | 2,732 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
#include <bits/stdc++.h>
//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;
int main(void) {
	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());	
	std::string A, B;
	std::cin >> A >> B;
	if (A.length() > B.length()) {
		std::cout << A << std::endl;
		return 0;
	}
	if (A.length() < B.length()) {
		std::cout << B << std::endl;
		return 0;
	}
	int i = 0;
	while (A[i] == B[i]) { i++; }
	if (A[i] == '4' && B[i] == '7') {
		std::cout << A << std::endl;
		return 0;
	}
	
	if (A[i] == '7' && B[i] == '4') {
		std::cout << B << std::endl;
		return 0;
	}
	if (A[i] > B[i]) {
		std::cout << A << std::endl;
	}
	else {
		std::cout << B << std::endl;
	}
}
            
            
            
        