@dikxarper

Ошибка связная с int main()?

#include <iostream>
using namespace std;

int main()
{
   int n, m, t;
   int sum1 = 0, sum2 = 0;
   cin >> n;

   int table[n][n];

   for (int i = 0; i < n; i++)
   {
      for (int j = 0; j < n; j++)
      {
         cin >> table[i][j];
         if (i == j)
         {
            sum1 = sum1 + table[i][j];
         }
         else if (i + j == n-1)
         {
            sum2 = sum2 + table[i][j];
         }
      }
   }
   cout << sum1 << " " << sum2 ;
   return 0;
}


ОШИБКА ВЫДАЕТ:
In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\istream:934:0,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\iostream:40,
from 404.cpp:1:
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\istream.tcc: In function 'int main()':
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\istream.tcc:8:4: error: 'cin' was not declared in this scope
cin >> n;
^~~
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\istream.tcc:24:4: error: 'cout' was not declared in this scope
cout << sum1 << " " << sum2+1;
^~~~
404.cpp: In function 'int main()':
404.cpp:4:5: error: redefinition of 'int main()'
int main()
^~~~
In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\istream:934:0,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\iostream:40,
from 404.cpp:1:
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\istream.tcc:4:5: note: 'int main()' previously defined here
int main()
  • Вопрос задан
  • 345 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы