| 1234567891011121314151617181920212223242526272829 |
- #include "main.h"
- int main(int argc, char **argv){
- QFile input("input.txt");
- if(!input.open(QIODevice::ReadOnly | QIODevice::Text)){
- qDebug() << "file borked";
- return 1;
- }
- QTextStream strm(&input);
- int cnt = 0;
- int last = 0;
- int act = 0;
- int cntHigher = 0;
- while(!strm.atEnd()){
- last = act;
- act = strm.readLine().toInt();
- cnt++;
- if (cnt == 1)
- continue;
- qDebug() << act;
- if(act > last){
- cntHigher++;
- qDebug() << "higher";
- }
- }
- qDebug() << cntHigher;
- }
|