摘要:
#include <iostream>#include <cstring>#include <cmath>using namespace std;char map[9][9];int n, m, t, di, dj;int dir[4][2] = {{0,-1}, {0, 1}, {1, 0}, {-1, 0}};//四个方向bool escape;void dfs(int si, int sj, int cnt){ int i, temp; if (si>n || si<=0 || sj>m || sj<=0) //边界 retur
阅读全文
摘要:
#include <iostream>#include <set>#include <string>#include <sstream> //使用stringstream需要用到的头文件using namespace std;string str;set<string> article; //set中不会有重复的元素int main(){ while (getline(cin, str) && str != "#") //getline(cin, string)可以接收空格,遇到换行结束 { str
阅读全文
摘要:
//好吧,水了。。。#include <cstdio>#include <cmath>#define PI 3.1415926using namespace std;//返回值是弧度,需要转换成角度double angle(double x1, double y1, double x2, double y2){ double dtheta,theta1,theta2; theta1 = atan2(y1,x1); theta2 = atan2(y2,x2); dtheta = theta2 - theta1; while (dtheta > PI) ...
阅读全文