Submission #1556652
Source Code Expand
#include<iostream> #include<string> using namespace std; int main(){ int a,c,d,e,f,max=0,min=100; string b; cin>>a>>b; for(int i=0;i<100;i++){ if(b[i]=="1"){ c++; } if(b[i]=="2"){ d++; } if(b[i]=="3"){ e++; } if(b[i]=="4"){ f++; } } if(max<c){ max=c; } if(max<d){ max=d; } if(max<e){ max=e; } if(max<f){ max=f; } if(min>c){ min=c; } if(min>d){ min=d; } if(min>e){ min=e; } if(min>f){ min=f; } cout<<max<<min<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - センター採点 |
User | Athena |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 552 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(b[i]=="1"){ ^ ./Main.cpp:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(b[i]=="2"){ ^ ./Main.cpp:16:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(b[i]=="3"){ ^ ./Main.cpp:19:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(b[i]=="4"){ ^