2013-03-08から1日間の記事一覧

AOJ 0589 - Production

aoj

冗長. #include<iostream> #include<vector> #include<algorithm> struct Product{ std::string name; int amount; }; int main(){ std::vector<Product> v; int n; std::cin >> n; for(int i=0;i<n;i++){ std::string name; int amount; std::cin >> name >> amount; auto it = std::find_if(v.begin(), v.end(), [&name](Pr…</n;i++){></product></algorithm></vector></iostream>

AOJ 0058 - Simple Calculator

aoj

かんたんなもんだいばかりといとるなー #include<iostream> int main(){ int res; std::cin >> res; char o; while(std::cin >> o, o != '='){ int n; std::cin >> n; if(o == '+')res += n; else if(o == '-')res -= n; else if(o == '*')res *= n; else if(o == '/')</iostream>…