F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39255282_20094.cpp:5:275: error: empty character constant
    5 | using namespace std; struct mystack{ char a[100010]; int t=0; void push(char x){ a[++t]=x; }char top(){ return a[t]; }void pop(){ t--; }int empty(){ return t==0?1:0; } }stk; int main(){ int n; cin>>n; getchar(); while(n--){ stack<char>s; while(1){ char ch=getchar(); if(ch!=''&&ch!='\n'&&ch!=EOF){ stk.push(ch); }else{ while(!stk.empty()){ cout<<stk.top(); stk.pop(); } if(ch=='')cout<<" "; }if(ch=='\n'||ch==EOF){ cout<<endl; break; } } } return 0; }
      |                                                                                                                                                                                                                                                                                   ^~
0_0_39255282_20094.cpp:5:378: error: empty character constant
    5 | using namespace std; struct mystack{ char a[100010]; int t=0; void push(char x){ a[++t]=x; }char top(){ return a[t]; }void pop(){ t--; }int empty(){ return t==0?1:0; } }stk; int main(){ int n; cin>>n; getchar(); while(n--){ stack<char>s; while(1){ char ch=getchar(); if(ch!=''&&ch!='\n'&&ch!=EOF){ stk.push(ch); }else{ while(!stk.empty()){ cout<<stk.top(); stk.pop(); } if(ch=='')cout<<" "; }if(ch=='\n'||ch==EOF){ cout<<endl; break; } } } return 0; }
      |                                                                                                                                                                                                                                                                                                                                                                                          ^~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-03 08:30:54, Gzip enabled