2015-11-07から1日間の記事一覧

C - 123引き算 / AtCoderBeginnerContest#011

abc011.contest.atcoder.jp #include <algorithm> #include <iostream> using namespace std; #define INF (1<<29) void Solve(int n) { int ng1, ng2, ng3; int dp[300+1]; bool flg=true; cin >> ng1 >> ng2 >> ng3; if (n==ng1 || n==ng2 || n==ng3) flg=false; if (flg) { for</iostream></algorithm>…

B - 名前の確認 / AtCoderBeginnerContest#011

abc011.contest.atcoder.jp #include <cctype> #include <iostream> #include <string> using namespace std; void Solve(string s) { s[0]=toupper(s[0]); for (int i=1; i<s.length(); ++i) s[i]=tolower(s[i]); cout << s << endl; } int main(void) { string s; cin >> s; Solve(s); return 0; } 最初の文字を大文字、以降の文字を小文字変換…</s.length();></string></iostream></cctype>