Создал(а) 'du3/program.c'
This commit is contained in:
parent
ca98481ed1
commit
d4364a3d88
23
du3/program.c
Normal file
23
du3/program.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#define LINE_SIZE 10
|
||||
int main(){
|
||||
char riadok[LINE_SIZE];
|
||||
memset(riadok, 0,LINE_SIZE);
|
||||
char* r = fgets(riadok,LINE_SIZE,stdin);
|
||||
assert(r!=NULL);
|
||||
int r2 = atol(riadok);
|
||||
int stop = 0;
|
||||
if (r2 == 0){
|
||||
printf("Konverzia sa nepodarila alebo v reťazci sa nachádza nula.");
|
||||
stop++;
|
||||
}
|
||||
if(stop == 0){
|
||||
printf("%d", r2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user