- 622 名前:デフォルトの名無しさん mailto:sage [2006/07/02(日) 22:17:10 ]
- #include <stdio.h>
#include <string.h> #include <stdlib.h> int main() { // ここから入力 char buf[200]; if (fgets(buf, sizeof(buf), stdin) == NULL) { // 入力終端or異常 } char * ptr; long foo = strtol(buf, & ptr, 10); if (ptr[0] != '\0') { // 数字以外の入力 } // ここから文字処理 for (unsigned ic = 0; ic < foo; ++ic) { putchar('$'); } return 0; }
|

|