Advertisement
askarulytarlan

geuioerhaiogh

Nov 15th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int a[4];
  10. int cnt = 1;
  11. int mx = -1;
  12.  
  13. int main() {
  14.  
  15. for(int i = 0; i < 4; i++){
  16. cin >> a[i];
  17. }
  18. mx = a[0];
  19. if(a[1] == mx ){
  20. cnt = cnt + 1;
  21. mx = a[1];
  22. if(a[2] == mx && a[3] == mx){
  23. cnt = cnt + 2;
  24. }
  25. else if(a[2] == mx || a[3] == mx){
  26. cnt = cnt + 1;
  27. }
  28. }
  29.  
  30. else if(a[2] == mx ){
  31. cnt = cnt + 1;
  32. mx = a[2];
  33. if(a[3] == mx){
  34. cnt = cnt + 1;
  35. }
  36.  
  37. }
  38. else if(a[3] == mx){
  39. cnt = cnt + 1;
  40. }
  41. cout << 4 - cnt;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement