Submission #1556649
Source Code Expand
#include<iostream> #include<string> using namespace std; int main(){ int a,c,d,e,f,max=0,min=100; string b[100]; 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 | 557 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:7:8: error: no match for ‘operator>>’ (operand types are ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ and ‘std::string [100] {aka std::basic_string<char> [100]}’) cin>>a>>b; ^ In file included from /usr/include/c++/5/iostream:40:0, from ./Main.cpp:1: /usr/include/c++/5/istream:168:7: note: candidate: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match> operator>>(bool& __n) ^ /usr/include/c++/5/istream:168:7: note: conversion of argument 1 would be ill-formed: ./Main.cpp:7:10: error: invalid initialization of non-const reference of type ‘bool&’ from an rvalue of type ‘bool’ cin>>a>>b; ^ In file included from /usr/include/c++/5/iostream:40:0, from ./Main.cpp:1: ...