- 72 名前:デフォルトの名無しさん mailto:sage [2008/12/17(水) 00:25:08 ]
- >>54
こんな感じ?文字定数('a' みたいなの)使えばASCIIコード知らなくてもできるよ #include <stdio.h> int main() { int c; while((c = getchar()) != '\n') if(c >= 'a' && c <= 'z') printf("%d", c - 'a' + 1); else if (c == ' ') printf("%d", c - ' ' + 27); putchar('\n'); return 0; }
|

|