2011-01-01から1ヶ月間の記事一覧

Effective Java 第2版

改訂によってJava1.6が対象となりました. 以下が追加されました. generics enum アノテーション 拡張for文(for-each) 自動boxing 可変長引数(...) staticインポート java.util.concurrent なんだか日本語訳がおかしい感じがしますが(英語直訳っぽい),時…

SRM 144 DIV2 250

class Time { public String whatTime(int seconds) { int h = seconds / 3600; seconds = seconds % 3600; int m = seconds / 60; seconds = seconds % 60; return h + ":" + m + ":" + seconds; } } Practice Roomで練習してみました. クラスはpublicにし…

POJ 1028

#include <iostream> #include <vector> using namespace std; int main(){ vector<string> urls; urls.push_back("http://www.acm.org/"); int idx = 0; string cmd; while (true) { cin >> cmd; if (cmd == "QUIT") return 0; else if (cmd == "VISIT") { for (int i=urls.size()-1; </string></vector></iostream>…

POJ 1005

#include <iostream> using namespace std; int main(){ int n; float x,y; cin >> n; for (int i=1; i<=n; i++) { cin >> x >> y; int year = (x*x + y*y) * 0.031415926535 + 1; cout << "Property " << i << ": This property will begin eroding in year " << year </iostream>…