- 博客(7)
- 收藏
- 关注
原创 解决sudo不能用的方法
今天在Mint下新添加了一个用户,但是在新用户下sudo命令不能使用,查了半个小时的资料终于解决了这个问题。下面将解决方法分享给大家,防止走弯路 1.进入root权限 2.将sudoers文件设置为可写:chmod 740 /etc/sudoers 3.打开sudoers文件:vi /etc/sudoers
2013-11-01 17:05:22
2150
原创 UVaOJ
#include #include #include using namespace std;struct node{ int r,c;}matrix[200];char s[1000];int main(){ int n,i,sum; char ch; scanf("%d",&n); node temp,temp2; bo
2013-10-11 22:04:44
1270
原创 UVaOJ 490 Rotating Sentences
In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program wil
2013-09-21 13:36:32
601
原创 UVaOj How many pieces of land?
你有一块椭圆的地。你可以在边界上选n个点,并两两连接得到n*(n-1)/2条线段。它们最多能把土地分成多少个部分? 样例输入:4 样例输出:8欧拉公式:V-E+F=2(V代表顶点数,E代表线段数,F代表面数,包含椭圆外的无穷大面),面数最多的情况是任意3条线段不会交于同一点。下面最重要的就是求出图中的顶点数目,线段数目,进而得到土地的块数。方法:对图中线段遍历(将线段看
2013-09-21 12:06:55
791
原创 UVaOJ 143 Orchard Trees
题目大意:果园里的树排列成矩阵,它们的x和y坐标均是1~99的整数。输入若干三角形,依次统计每一个三角形内部和边界上共有多少棵树。这个题目似乎与高中的解析几何几何有关系,但是若把它当做解析几何来做,就会在无形中增加题目的难度。换个思路,假设三角形ABC,若一个点O在三角形ABC中,则必有S-ABC=S-OAB+S-OAC+S-OBC,变成面积关系即可。 1 #include 2
2013-09-21 11:34:47
577
原创 初学java小结1
Scanner类的应用:使用scanner类时,要创建一个对象:Scanner input = new Scanner(System.in)这里指的是控制台输入流。需要注意的是,Scanner在不使用时要关闭,即input.close();
2013-09-20 17:54:35
593
原创 解决tomcat服务器端口占用的方法
今天下午做了一个小网站玩玩,没想到点完运行总是会出现这样的错误:Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system pro
2013-07-24 20:10:38
886
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人