first commit
This commit is contained in:
parent
cd2da90353
commit
9939ac7c81
23
main.c
Normal file
23
main.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user