Advertisement
return0_0

Untitled

Oct 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. setlocale(LC_ALL, "");
  6. int a[10];
  7. for (int j = 9; j >= 0; j--) {
  8. for (int i = 0; i < 10; i++) {
  9. cin >> a[i];
  10. }
  11. int imax = a[1];
  12. for (int i = 0; i < 10; i++) {
  13. if (a[i] > imax) {
  14. imax = a[i];
  15. }
  16. }
  17. int k = 0;
  18. for (int i = 0; i < 10; i++) {
  19. if (a[i] = imax) {
  20. k++;
  21. }
  22. }
  23. if (k >= 2) {
  24. cout << "Максимальное число, встречающееся более одного раза =" << imax;
  25. return 0;
  26. }
  27.  
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement