結果
| 問題 | No.293 4>7の世界 | 
| コンテスト | |
| ユーザー |  suppy193 | 
| 提出日時 | 2016-06-27 13:43:11 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 661 bytes | 
| コンパイル時間 | 219 ms | 
| コンパイル使用メモリ | 22,528 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-11 22:22:59 | 
| 合計ジャッジ時間 | 1,184 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 18 WA * 2 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%lld%lld", &a, &b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <math.h>
int main(void) {
	
	long long int a, b;
	char a_str[15], b_str[115];
	int i;
	scanf("%lld%lld", &a, &b);
	
	if((int)log((double)a) != (int)(log((double)b))){
		if(a > b){
			printf("%lld\n", a);
		}
		else{
			printf("%lld\n", b);
		}
	}
	else{
		sprintf(a_str, "%lld", a);
		sprintf(b_str, "%lld", b);
		i = 0;
		while(a_str[i] != '\0'){
			if(a_str[i] == '4' && b_str[i] == '7'){
				printf("%s\n", a_str);
				return 0;
			}
			if(a_str[i] == '7' && b_str[i] == '4'){
				printf("%s\n", b_str);
				return 0;
			}
			i++;
		}
		if(a > b){
			printf("%lld\n", a);
		}
		else{
			printf("%lld\n", b);
		}
	}
	return 0;
}
            
            
            
        