fork download
  1. #include <iostream>
  2. using namespace std;
  3. #define AMNT 15
  4.  
  5. int main() {
  6. int p, k;
  7. int current, previous;
  8. cin >> p;
  9. while ( p--) {
  10. cin >> k;
  11. int isl = 0;
  12. cin >> current; // ввод 1-го элемента последовательности
  13. previous = current;
  14. for ( int j = 1; j < AMNT ; j++ ){
  15. cin >> current; //ввод остальных элементов
  16. if ( current > previous ) {
  17. isl++;
  18. }
  19. previous = current;
  20. }
  21. cout << k << " " << isl << endl;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 4396KB
stdin
4
1 0 0 1 1 2 2 1 1 0 1 2 2 1 1 0
2 0 1 2 3 4 3 2 1 2 3 4 3 2 1 0
3 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
4 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
stdout
1 4
2 7
3 7
4 7