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

AOJ 0113 - Period

aoj

書くだけ.汚いです. #include <iostream> #include <vector> #include <algorithm> typedef std::pair<int, int> P; int main(){ int a = 0, b = 0; while(std::cin >> a >> b, !std::cin.eof()){ std::vector<P> v; while(a%b){ a *= 10; if(std::find(v.begin(), v.end(), P(a%b, a/b)) != v.end())</p></int,></algorithm></vector></iostream>…

AOJ 0125 - Day count

aoj

書くだけ. #include <iostream> int MAX_DAY[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; class Data{ public: Data(int _year, int _month, int _day) : year(_year), month(_month), day(_day){} void add(){ if(year%4 == 0){ if(year%100 != 0 || </iostream>…