2012-03-24から1日間の記事一覧

AOJ_0017 Caesar Cipher

問題 getlineの使い方がわからないのでコードが変になった↓恐ろしく非効率なコード #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; char text[3][5] = { "this", "the", "that", }; char S[100]; char A[100]; int len; void solve(){ char </algorithm></cstring></cstdio></iostream>…

AOJ_0012 A Point in a Triangle

問題 解法 △ABC = △PAB + △PBC + △+PCA がなりたてば内部にある。 面積はベクトルの外積を使えば求まるらしい。 #include <cstdio> #include <algorithm> #define EPS 1e-9 class P{ public: double x, y; double cross(P p){ //外積を求める return (x * p.y - y * p.x); } P o</algorithm></cstdio>…