23 lines
421 B
C
23 lines
421 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#define LINE_SIZE 999
|
|
|
|
int main(){
|
|
char line[LINE_SIZE] = "1 2 3 4";
|
|
int len = strlen(line);
|
|
char* endptr = NULL;
|
|
char* start = line;
|
|
int num = 0;
|
|
while (start < (line + len)){
|
|
num = strtol(start,&endptr,10);
|
|
if (num){
|
|
printf("Nacital som %d\n",num);
|
|
start = endptr + 1;
|
|
}
|
|
else
|
|
break;
|
|
}
|
|
return 0;
|
|
}
|