• Помогите изменить так,чтобы не было ошибки.Прошу:
    #include<stdio.h>
    int sum( int x, int y);
    {
    int s;
    s=x+y;
    return s;
    }
    int main()
    {
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);
    z=sum(100,5);
    printf("%d",z);
    }
    .............................

    Вот комментарий:
    cpp:3: error: syntax error before `{' token
    cpp:5: error: ISO C++ forbids declaration of `s' with no type
    cpp:5: error: `x' was not declared in this scope
    cpp:5: error: `y' was not declared in this scope
    cpp:6: error: syntax error before `return'

Ответы 1

  • #include <iostream>using namespace std;int sum( int x, int y){return x+y;}int main(){int x,y,z;scanf("%d%d",&x,&y);z=sum(x,y);printf("%d",z);}Пример:100 5105
    • Автор:

      apple31
    • 5 лет назад
    • 0
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years