Submission #117249

# Submission time Handle Problem Language Result Execution time Memory
117249 2019-06-15T12:03:58 Z maho04 scanf 함수 2 (BSC_0_4) C++14
Compilation error
0 ms 0 KB
#include <iostream>
using namespace std;
int main(){
  string a;
  cin >> a;
  if(a.length()==1)
  {
    a.insert(1,"00");
    cout<<a;
  }
  else if(a.lenth()==2)
  {
    a.insert(1,"0");
    cout<<a;
  }
  else if(a.lenth()==3)
  {
    cout<<a;
  }
}

Compilation message

scanf2.cpp: In function 'int main()':
scanf2.cpp:11:13: error: 'std::__cxx11::string {aka class std::__cxx11::basic_string<char>}' has no member named 'lenth'; did you mean 'length'?
   else if(a.lenth()==2)
             ^~~~~
             length
scanf2.cpp:16:13: error: 'std::__cxx11::string {aka class std::__cxx11::basic_string<char>}' has no member named 'lenth'; did you mean 'length'?
   else if(a.lenth()==3)
             ^~~~~
             length