摘要:View Code 1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 // 精度容差 6 const double EPS = 1e-5; 7 8 // 允许容差的浮点数相等 9 inline bool equals( double x, double y ) { 10 return fabs( x - y ) < EPS; 11 } 12 13 // 点结构 14 struct Point { 15 Point() {} 16 Point( dou...
阅读全文
摘要:View Code 1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 #include <string> 5 #include <string.h> 6 7 int main() 8 { 9 /*ifstream cin("1.txt");//*/10 /*ofstream cout("2.txt");//*/11 int cas; 12 cin>>cas; 13 char ch[10000];14 while
阅读全文
摘要:规律题-------------------DP 1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 5 int c = 0;// 6 int isleap; 7 const int cal[2][15]={ 8 {0,31,28,31,30,31,30,31,31,30,31,30,31}, 9 {0,31,29,31,30,31,30,31,31,30,31,30,31}//leap year10 };11 bool calendar[2002][13][32] = {0};//..
阅读全文
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 6 long long yanghui[22][222] = {0}; 7 8 void init() 9 {10 int row,column;11 12 for(row = 1; row < 20; ++ row){13 yanghui[row][0] = 1;14 for(column = 0; yanghui[row][col...
阅读全文