commit e2b0edd5d49d75040a9dce45dfec24ec93f344fe
parent bacdc0f7c7d45928651052a1661d4eaf30a6ccd2
Author: Martin J. Klöckner <martin.cachari@gmail.com>
Date: Sat, 14 Nov 2020 12:57:51 -0300
Merge branch 'master' of github.com:klewer-martin/c-repo
Updating repo
Diffstat:
1 file changed, 0 insertions(+), 42 deletions(-)
diff --git a/guia02/ej7_2.c b/guia02/ej7_2.c
@@ -1,42 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#define MAX_LEN 5 // max digits of the entered degree;
-#define ERR_MSG_LEN "El angulo ingresado contiene demasiados digitos"
-
-typedef enum {
- AGUDO, OBTUSO, RECTO
-} angulo_t;
-
-void clean(char *buffer)
-{
- for(size_t i = 0; i < MAX_LEN; i++)
- buffer[i] = '\0';
-}
-
-
-int main(void) {
-
- char buffer[MAX_LEN];
- int c, d, i;
- i = 0;
-
- while((c = getchar()) != EOF) {
- if(c != '\n') {
- if(i < MAX_LEN) {
- buffer[i] = c;
- i++;
- } else if(i > MAX_LEN) {
- fprintf(stderr, ERR_MSG_LEN"\n");
- return 1;
- }
- }
- i = 0;
- d = atoi(buffer);
- printf("%d\n", d);
- clean(buffer);
- }
-
- return 0;
-}