結果

問題 No.327 アルファベット列
ユーザー ghasshee
提出日時 2016-01-01 03:07:20
言語 C90
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 547 bytes
コンパイル時間 763 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-19 09:03:52
合計ジャッジ時間 9,649 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:35:11: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
   35 |     int n=atoi(argv[1]);
      |           ^~~~

ソースコード

diff #

/*
 * this is the program which  
 * convert NUM to STRING
 * 
 *     0  ...  25    
 *     A  ...   Z    
 * 
 *    26  ...  51  <-- INPUT
 *    AA  ...  AZ  <-- OUTPUT
 * 
 *    ..  ...  ..
 * 
 *   676  ... 701
 *    ZA  ...  ZZ
 *
 *   702  ...
 *   AAA  ...
 */


#include<stdio.h>
#include<string.h>

void loop(int n)
{
    if (n>25){
        loop(n/26-1);
        printf("%c",'A'+n%26);
    }else 
        printf("%c",'A'+n);
}

int main(int argc, char** argv)
{
    int n=atoi(argv[1]);
    loop(n);
    printf("\n");
    
    return 0;
}
0