From 9939ac7c81a219ff5dc96fc568fb03fdb2930050 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 29 Oct 2019 14:14:29 +0100 Subject: [PATCH] first commit --- main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..e1347fc --- /dev/null +++ b/main.c @@ -0,0 +1,23 @@ +#include +#include "stdlib.h" +int main() { + char* prve_cislo = malloc(100* sizeof(char)); + char* druhe_cislo = malloc(100* sizeof(char)); + fgets(prve_cislo,100,stdin); + int cislo1 = strtof(prve_cislo,NULL); + int cislo2; + while((fgets(druhe_cislo,100,stdin))){ + cislo2= strtof(druhe_cislo,NULL); + while (cislo1 != cislo2){ + if (cislo1 > cislo2){ + cislo1 -= cislo2; + } else{ + cislo2 -= cislo1; + } + } + + printf("%d",cislo1); + } + + free(prve_cislo); +} \ No newline at end of file