DSA
This commit is contained in:
parent
bd813885ae
commit
81d34b9541
BIN
du3/program
BIN
du3/program
Binary file not shown.
@ -4,11 +4,21 @@
|
|||||||
#define LINE_SIZE 999
|
#define LINE_SIZE 999
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
char line[LINE_SIZE] = "1 2 3 4";
|
char riadok[LINE_SIZE];
|
||||||
|
memset(riadok, 0,LINE_SIZE);
|
||||||
|
char* r = fgets(riadok,LINE_SIZE,stdin);
|
||||||
|
char line[LINE_SIZE];
|
||||||
int len = strlen(line);
|
int len = strlen(line);
|
||||||
char* endptr = NULL;
|
char* endptr = NULL;
|
||||||
char* start = line;
|
char* start = line;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
if (r == NULL){
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
int r2 = atol(line);
|
||||||
|
if (r2 == 0){
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
while (start < (line + len)){
|
while (start < (line + len)){
|
||||||
num = strtol(start,&endptr,10);
|
num = strtol(start,&endptr,10);
|
||||||
if (num){
|
if (num){
|
||||||
|
Loading…
Reference in New Issue
Block a user