mirror of
https://github.com/tiennm99/HDH.git
synced 2026-06-09 04:18:33 +00:00
18 lines
257 B
C
18 lines
257 B
C
#include "readline.h"
|
|
#include <ctype.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int read_line(char *str) {
|
|
fgets(str, 51, stdin);
|
|
fputs(str, stdout);
|
|
int i = 0;
|
|
while (str[i] != '\n') {
|
|
if (!isdigit(str[i])) {
|
|
return 0;
|
|
}
|
|
++i;
|
|
}
|
|
return 1;
|
|
}
|