fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 9;
  5. int freq[MAX_SIZE + 1];
  6.  
  7. int main() {
  8. int mt[MAX_SIZE + 1][MAX_SIZE + 1];
  9. for (int i = 1; i <= MAX_SIZE; ++i) {
  10. for (int j = 1; j <= MAX_SIZE; ++j) {
  11. cin >> mt[i][j] ;
  12. }
  13. }
  14. int keepPlay = 1;
  15. for (int i = 1; i <= MAX_SIZE ; ++i) {
  16. for (int j = 1; j <= MAX_SIZE; ++j) {
  17. ++freq[mt[i][j]];
  18. ++freq[mt[j][i]];
  19. }
  20. }
  21. for (int i = 1; i <= MAX_SIZE ; ++i) {
  22. cout << freq[i] <<" ";
  23. }
  24. if (keepPlay == 1) {
  25. cout << "corect";
  26. } else {
  27. cout << "incorect";
  28. }
  29. // cout<< freq[mt[i][j]] << ")" << i <<" " << j << " | " << freq[mt[column][i]] <<")"<< column << " " << i <<" \n";
  30. return 0;
  31. }
Success #stdin #stdout 0.01s 5300KB
stdin
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
stdout
18 18 18 18 18 18 18 18 18 corect