Submission #19542441


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

void f(int a, int b){
  if(a < b) cout << "up " << b - a << endl;
  if(a == b) cout << "stay" << endl;
  if(a > b) cout << "down " << a - b << endl;
}

int main() {
  int n;
  cin >> n;
  
  vector<int>a(n);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
    if(i == 0) continue;
    f(a.at(i-1), a.at(i))
  } 
}

Submission Info

Submission Time
Task B - Up and Down
User S_Eto
Language C++ (GCC 9.2.1)
Score 0
Code Size 383 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:18:26: error: expected ‘;’ before ‘}’ token
   18 |     f(a.at(i-1), a.at(i))
      |                          ^
      |                          ;
   19 |   }
      |   ~