답안 #465132

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
465132 2021-08-15T08:38:46 Z kilikuma Colouring a rectangle (eJOI19_colouring) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h> 
using namespace std;
long mini(long a, long b) {
  if (a<b)return a; else return b; 
}
int main() {
  int nbLigs, nbCols; 
  cin >> nbLigs >> nbCols; 
  long grille[nbCols+1];
  for (int iCol = nbCols-1;iCol >= 0; iCol --) {
    cin >> grille[iCol]; 
  } 
  for (int iCol = 0; iCol < nbCols; iCol ++) {
    int a; cin >> a; 
    grille[iCol] = mini(grille[iCol], a); 
  }
  long somme = 0; 
  for (int iCol = 0; iCol < nbCols; iCol ++) {
    somme += grille[iCol]; 
  }
  printf("%ld\n", grille[iCol]); 
}

Compilation message

colouring.cpp:18:45: error: extended character   is not valid in an identifier
   18 |   for (int iCol = 0; iCol < nbCols; iCol ++) {
      |                                             ^
colouring.cpp: In function 'int main()':
colouring.cpp:18:45: error: '\U000000a0' was not declared in this scope
   18 |   for (int iCol = 0; iCol < nbCols; iCol ++) {
      |                                             ^
colouring.cpp:21:26: error: 'iCol' was not declared in this scope
   21 |   printf("%ld\n", grille[iCol]);
      |                          ^~~~
colouring.cpp:17:8: warning: unused variable 'somme' [-Wunused-variable]
   17 |   long somme = 0;
      |        ^~~~~