摘要:
A particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time? Input The input will contain two integers i... 阅读全文
摘要:
A particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time? Input The input will contain two integers i... 阅读全文
摘要:
Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that... 阅读全文
摘要:
he just calculates one thing, the difference between his soldier number and the opponent's soldier number. From this difference he decides whether to fight or not. Hashmat's soldier number is never greater than his opponent.InputThe input contains two integer numbers in every line. These two 阅读全文
摘要:
明明题目上写着不要输出多余的空白行,可是最后还是需要一个空白行的,白白让我郁闷了多次WA: #include<iostream>using namespace std;int main(){ int i_case; cin >> i_case; while(i_case--) { int farmer; cin >> farmer; ... 阅读全文
摘要:
这道题本来是想自己写一个判断是否是英文字符的函数的,错误了,现在还不是很明白,如下: #include<iostream>#include<string>#include<cctype>using namespace std;int main(){ string line; while(getline(cin, line)) { int cnt = 0, flag ... 阅读全文
摘要:
转载:自判断点是否在三角形内部 给定三角形ABC和一点P(x,y,z),判断点P是否在ABC内。这是游戏设计中一个常见的问题。需要注意的是,这里假定点和三角形位于同一个平面内。 内角和法 连接点P和三角形的三个顶点得到三条线段PA,PB和PC,求出这三条线段与三角形各边的夹角,如果所有夹角之和为360度,那么点P在三角形内,否则不在,此法直观,但效率低下。 同向法 假设点P位于三角形内,会有这样... 阅读全文
|