Language: C++

Last login: Mon Dec 26 14:34:37 on console
sira-no-MacBook-Air:~ sira$ ls
Desktop		Downloads	Movies		Pictures
Documents	Library		Music		Public
sira-no-MacBook-Air:~ sira$ cd Desktop/
sira-no-MacBook-Air:Desktop sira$ ls
Programing
sira-no-MacBook-Air:Desktop sira$ cd Programing/
sira-no-MacBook-Air:Programing sira$ ls
A-un_Breathing
Curry_Making
Entrance_Examination
Hanafuda_Shuffle
Koto_Municipal_Subway
Score_Totalizer
Selection_of_Participants_of_an_Experiment
vim.txt
sira-no-MacBook-Air:Programing sira$ cd Entrance_Examination/
sira-no-MacBook-Air:Entrance_Examination sira$ ls
Sample.dat	work		work.cpp
sira-no-MacBook-Air:Entrance_Examination sira$ vim work.cpp



                vector<int> data(m);
                for(i = 0; i < m; i++){
                        cin >> data[i];
                }   

                vector<int> diff(m-1);
                for(i = 0; i < m-1; i++){
                        diff[i] = data[i] - data[i+1];
                }

                for(i = nmin-1; i < nmax; i++){
                        if(diff[i] >= Diff){
                                Diff = diff[i];
                                num = i;
                        }
                }
                cout << num + 1 << endl;
                vector<int>().swap(data);
                vector<int>().swap(diff);
        }
        return 0;
}

Compiler output:
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Mon Dec 26 14:34:37 on console
      | ^~~~
a.cc:26:17: error: expected unqualified-id before 'for'
   26 |                 for(i = 0; i < m; i++){
      |                 ^~~
a.cc:26:28: error: 'i' does not name a type
   26 |                 for(i = 0; i < m; i++){
      |                            ^
a.cc:26:35: error: 'i' does not name a type
   26 |                 for(i = 0; i < m; i++){
      |                                   ^
a.cc:30:17: error: 'vector' does not name a type
   30 |                 vector<int> diff(m-1);
      |                 ^~~~~~
a.cc:31:17: error: expected unqualified-id before 'for'
   31 |                 for(i = 0; i < m-1; i++){
      |                 ^~~
a.cc:31:28: error: 'i' does not name a type
   31 |                 for(i = 0; i < m-1; i++){
      |                            ^
a.cc:31:37: error: 'i' does not name a type
   31 |                 for(i = 0; i < m-1; i++){
      |                                     ^
a.cc:35:17: error: expected unqualified-id before 'for'
   35 |                 for(i = nmin-1; i < nmax; i++){
      |                 ^~~
a.cc:35:33: error: 'i' does not name a type
   35 |                 for(i = nmin-1; i < nmax; i++){
      |                                 ^
a.cc:35:43: error: 'i' does not name a type
   35 |                 for(i = nmin-1; i < nmax; i++){
      |                                           ^
a.cc:41:17: error: 'cout' does not name a type
   41 |                 cout << num + 1 << endl;
      |                 ^~~~
a.cc:42:17: error: 'vector' does not name a type
   42 |                 vector<int>().swap(data);
      |                 ^~~~~~
a.cc:43:17: error: 'vector' does not name a type
   43 |                 vector<int>().swap(diff);
      |                 ^~~~~~
a.cc:44:9: error: expected declaration before '}' token
   44 |         }
      |         ^
a.cc:45:9: error: expected unqualified-id before 'return'
   45 |         return 0;
      |         ^~~~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^