結果

問題 No.327 アルファベット列
ユーザー suppy193
提出日時 2017-02-02 12:06:13
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 02:31:09
合計ジャッジ時間 1,820 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 29 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%lld", &n);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	long long int n;
	char s[20] = {0};
	int i;
	scanf("%lld", &n);

	s[0] = n % 26 + 'A';
	n /= 26;
	i = 1;
	do {
		s[i] = n % 26 + 'A' - 1;
		n /= 26;
		i++;
	}while(n > 0);
	s[i] = '\0';
	//printf("%s\n", s);
	i--;
	do {
		printf("%c", s[i]);
		i--;
	}while(i >= 0);
	printf("\n");

	return 0;
}
0