Advertisement
Bitroy

J sorevnovanie

Jan 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int a, b, q = 0, cout = 0, max = -1, prob = 1;
  6. scanf ("%d%d", &a, &b);
  7. int mas[100][100];
  8. int arr[100];
  9.  
  10. for (int i = 0; i < a; i++)
  11. {
  12. for (int j = 0; j < b; j++)
  13. {
  14. scanf ("%d", &mas[i][j]);
  15. }
  16. }
  17. for (int i = 0; i < a; i++)
  18. {
  19. for (int j = 0; j < b; j++)
  20. {
  21. if (mas[i][j] > max)
  22. {
  23. max = mas[i][j];
  24. prob = 1;
  25. }
  26. }
  27.  
  28. }
  29. for (int i = 0; i < a; i++)
  30. {
  31. for (int j = 0; j < b; j++)
  32. {
  33. if (max == mas[i][j] && prob == 1)
  34. {
  35. cout++;
  36. arr[q] = i;
  37. prob = 0;
  38. q++;
  39. }
  40. }
  41. prob = 1;
  42. }
  43.  
  44. printf ("%d\n", cout);
  45. for(int i = 0; i < q; i++)
  46. {
  47. printf ("%d\n", arr[i]);
  48. }
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement