2014-09-14から1日間の記事一覧

0084 - Search Engine

#include <iostream> #include <sstream> #include <string> using namespace std; void Slove(string str) { string word; stringstream ss; bool flg=false; for (int i=0; i<str.length(); ++i) if (str[i]=='.' || str[i]==',') str[i]=' '; ss << str; while (ss >> word) if (3<=word.length() && word.length()<=6) …</str.length();></string></sstream></iostream>

0083 - Era Name Transformation

#include <iostream> #include <string> using namespace std; void Slove(int year, int month, int day) { const string era[5]={"pre-meiji", "meiji", "taisho", "showa", "heisei"}; const long long int period[4]={18680908, 19120730, 19261225, 19890108}; long long </string></iostream>…