Submission #1696808


Source Code Expand

#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main(){
    string s;
    cin >> s;
    transform(s.begin(), ::toupper);
    cout << "A + s[0] + C" << endl;
    
    return 0;
}

Submission Info

Submission Time
Task A - AtCoder *** Contest
User hystyl243
Language C++14 (GCC 5.4.1)
Score 0
Code Size 246 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:35: error: no matching function for call to ‘transform(std::basic_string<char>::iterator, int (&)(int) throw ())’
     transform(s.begin(), ::toupper);
                                   ^
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./Main.cpp:4:
/usr/include/c++/5/bits/stl_algo.h:4164:5: note: candidate: template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)
     transform(_InputIterator __first, _InputIterator __last,
     ^
/usr/include/c++/5/bits/stl_algo.h:4164:5: note:   template argument deduction/substitution failed:
./Main.cpp:10:35: note:   deduced conflicting types for parameter ‘_IIter’ (‘__gnu_cxx::__normal_iterator<char*, std::basic_string<char> >’ and ‘int (*)(int) throw ()’)
     transform(s.begin(), ::toupper);
                                   ^
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./Main.cpp:4:...