답안 #568361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568361 2022-05-25T09:12:24 Z Trisanu_Das Mini tetris (IOI16_tetris) C++17
컴파일 오류
0 ms 0 KB
#include "tetris.h"
#include <bits/stdc++.h>
using namespace std;

void init(int n){}
int st = 0, pos, rot;
int r1[6] = {0, 1, 1, 0, 0, 0}, p1[6] = {0, 2, 0, 0, 1, 1}, n1[6] = {1, 3, 4, 0, 0, 1};
int r2[6] = {0, 2, 3, 0, 1, 2}, p2[6] = {0, 1, 0, 0, 1, 1}, n2[6] = {5, 2, 1, 4, 3, 0};
void new_figure(int type){
  if(type == 1){pos = 0; rot = 0;}
  if(type == 2){
    rot = r1[st];
    pos = p1[st];
    st = n1[st];
  }
  if(type == 3){
    rot = r2[st];
    pos = p2[st];
    st = n2[st];
  }
}
int get_position() return pos;
int get_rotation() return rotation;

Compilation message

tetris.cpp: In function 'int get_position()':
tetris.cpp:22:20: error: named return values are no longer supported
   22 | int get_position() return pos;
      |                    ^~~~~~
tetris.cpp:23:35: error: expected '{' at end of input
   23 | int get_rotation() return rotation;
      |                                   ^
tetris.cpp:23:35: warning: no return statement in function returning non-void [-Wreturn-type]