|
|
|
|
|
|
|
Вернуться
| 1 Андрей и Костя, 09 июня 2013 г. 10:24:07 | |
попробуй так #include <fstream> using namespace std; int main() { ifstream infile("input.txt"); ofstream outfile("output.txt"); int n,arr[100][100];; infile >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { infile >> arr[i][j]; } } int counter = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (arr[i][j] == 1) counter++; } } outfile << counter / 2; return 0; }
|
|
|
| 2 Андрей и Костя, 09 июня 2013 г. 10:22:53 | |
короче infile >> n; int arr[n][n]; так писать нельзя
|
|
|
Чтобы оставить сообщение необходимо зарегистрироваться и авторизоваться!
| | | |