█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 5047

Problema 0x78 - Suma de 2 números

  • Autor: Sergio.Urrego
  • Fecha: 2021-10-08 04:08:46 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:3:7: error: expected parameter declarator
scanf("%d %d", &a, &b);
      ^
main.c:3:7: error: expected ')'
main.c:3:6: note: to match this '('
scanf("%d %d", &a, &b);
     ^
main.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
scanf("%d %d", &a, &b);
^
main.c:3:1: error: conflicting types for 'scanf'
/usr/include/stdio.h:412:24: note: previous declaration is here
extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
                       ^
main.c:4:8: error: expected parameter declarator
printf("%d\n", (int)a + (int)b);
       ^
main.c:4:8: error: expected ')'
main.c:4:7: note: to match this '('
printf("%d\n", (int)a + (int)b);
      ^
main.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
printf("%d\n", (int)a + (int)b);
^
main.c:4:1: error: conflicting types for 'printf'
/usr/include/stdio.h:332:12: note: previous declaration is here
extern int printf (const char *__restrict __format, ...);
           ^
2 warnings and 6 errors generated.

                    
#2
Error de compilación
                      main.c:3:7: error: expected parameter declarator
scanf("%d %d", &a, &b);
      ^
main.c:3:7: error: expected ')'
main.c:3:6: note: to match this '('
scanf("%d %d", &a, &b);
     ^
main.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
scanf("%d %d", &a, &b);
^
main.c:3:1: error: conflicting types for 'scanf'
/usr/include/stdio.h:412:24: note: previous declaration is here
extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
                       ^
main.c:4:8: error: expected parameter declarator
printf("%d\n", (int)a + (int)b);
       ^
main.c:4:8: error: expected ')'
main.c:4:7: note: to match this '('
printf("%d\n", (int)a + (int)b);
      ^
main.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
printf("%d\n", (int)a + (int)b);
^
main.c:4:1: error: conflicting types for 'printf'
/usr/include/stdio.h:332:12: note: previous declaration is here
extern int printf (const char *__restrict __format, ...);
           ^
2 warnings and 6 errors generated.

                    
#3
Error de compilación
                      main.c:3:7: error: expected parameter declarator
scanf("%d %d", &a, &b);
      ^
main.c:3:7: error: expected ')'
main.c:3:6: note: to match this '('
scanf("%d %d", &a, &b);
     ^
main.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
scanf("%d %d", &a, &b);
^
main.c:3:1: error: conflicting types for 'scanf'
/usr/include/stdio.h:412:24: note: previous declaration is here
extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
                       ^
main.c:4:8: error: expected parameter declarator
printf("%d\n", (int)a + (int)b);
       ^
main.c:4:8: error: expected ')'
main.c:4:7: note: to match this '('
printf("%d\n", (int)a + (int)b);
      ^
main.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
printf("%d\n", (int)a + (int)b);
^
main.c:4:1: error: conflicting types for 'printf'
/usr/include/stdio.h:332:12: note: previous declaration is here
extern int printf (const char *__restrict __format, ...);
           ^
2 warnings and 6 errors generated.

                    
#4
Error de compilación
                      main.c:3:7: error: expected parameter declarator
scanf("%d %d", &a, &b);
      ^
main.c:3:7: error: expected ')'
main.c:3:6: note: to match this '('
scanf("%d %d", &a, &b);
     ^
main.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
scanf("%d %d", &a, &b);
^
main.c:3:1: error: conflicting types for 'scanf'
/usr/include/stdio.h:412:24: note: previous declaration is here
extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
                       ^
main.c:4:8: error: expected parameter declarator
printf("%d\n", (int)a + (int)b);
       ^
main.c:4:8: error: expected ')'
main.c:4:7: note: to match this '('
printf("%d\n", (int)a + (int)b);
      ^
main.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
printf("%d\n", (int)a + (int)b);
^
main.c:4:1: error: conflicting types for 'printf'
/usr/include/stdio.h:332:12: note: previous declaration is here
extern int printf (const char *__restrict __format, ...);
           ^
2 warnings and 6 errors generated.

                    
#5
Error de compilación
                      main.c:3:7: error: expected parameter declarator
scanf("%d %d", &a, &b);
      ^
main.c:3:7: error: expected ')'
main.c:3:6: note: to match this '('
scanf("%d %d", &a, &b);
     ^
main.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
scanf("%d %d", &a, &b);
^
main.c:3:1: error: conflicting types for 'scanf'
/usr/include/stdio.h:412:24: note: previous declaration is here
extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
                       ^
main.c:4:8: error: expected parameter declarator
printf("%d\n", (int)a + (int)b);
       ^
main.c:4:8: error: expected ')'
main.c:4:7: note: to match this '('
printf("%d\n", (int)a + (int)b);
      ^
main.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
printf("%d\n", (int)a + (int)b);
^
main.c:4:1: error: conflicting types for 'printf'
/usr/include/stdio.h:332:12: note: previous declaration is here
extern int printf (const char *__restrict __format, ...);
           ^
2 warnings and 6 errors generated.

                    
Puntos totales: 0 / 100

Código

#include <stdio.h>

scanf("%d %d", &a, &b);
printf("%d\n", (int)a + (int)b);