제출 #1176999

#제출 시각아이디문제언어결과실행 시간메모리
1176999husu1331Crtanje (COCI20_crtanje)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back int main() { ll n; cin>>n; ll ps=0; ll ms=0; ll es=0; while(n--){ char ch; cin>>ch; if(ch=="+"){ ps++; } if(ch=="="){ es++; } if(ch=="-"){ ms++; } } ll maks; ll cur; char ct; if(ps>ms){ ct='\'; maks=ps; cur=ms; } else{ ct="/"; maks=ms; cur=ps; } ll c[maks][n]; if(ct=='/'){ bool b=false; for(ll i=0;i<maks;i++){ if(cur==0){ b==true; } for(ll j=0;j<n;j++){ if(cur==maks){ if(j==cur){ c[i][j]='_'; continue; } else{ c[i][j]='.'; continue } } if(j==cur-1 and b==false){ c[i][j]='/'; cur--; } else if(b==true){ if(j==cur){ c[i][j]='\'; cur++; } else{ c[i][j]='.'; } } else{ c[i][j]=='.'; } } } } }

컴파일 시 표준 에러 (stderr) 메시지

crtanje.cpp:29:8: warning: missing terminating ' character
   29 |     ct='\';
      |        ^
crtanje.cpp:29:8: error: missing terminating ' character
   29 |     ct='\';
      |        ^~~~
crtanje.cpp:62:21: warning: missing terminating ' character
   62 |             c[i][j]='\';
      |                     ^
crtanje.cpp:62:21: error: missing terminating ' character
   62 |             c[i][j]='\';
      |                     ^~~~
crtanje.cpp: In function 'int main()':
crtanje.cpp:15:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(ch=="+"){
      |          ~~^~~~~
crtanje.cpp:18:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |       if(ch=="="){
      |          ~~^~~~~
crtanje.cpp:21:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |       if(ch=="-"){
      |          ~~^~~~~
crtanje.cpp:34:8: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   34 |     ct="/";
      |        ^~~
      |        |
      |        const char*
crtanje.cpp:53:21: error: expected ';' before '}' token
   53 |             continue
      |                     ^
      |                     ;
   54 |           }
      |           ~