main.cpp 491 B

1234567891011121314151617181920212223242526272829
  1. #include "main.h"
  2. int main(int argc, char **argv){
  3. QFile input("input.txt");
  4. if(!input.open(QIODevice::ReadOnly | QIODevice::Text)){
  5. qDebug() << "file borked";
  6. return 1;
  7. }
  8. QTextStream strm(&input);
  9. int cnt = 0;
  10. int last = 0;
  11. int act = 0;
  12. int cntHigher = 0;
  13. while(!strm.atEnd()){
  14. last = act;
  15. act = strm.readLine().toInt();
  16. cnt++;
  17. if (cnt == 1)
  18. continue;
  19. qDebug() << act;
  20. if(act > last){
  21. cntHigher++;
  22. qDebug() << "higher";
  23. }
  24. }
  25. qDebug() << cntHigher;
  26. }