一道很简单的模拟题
#include<cstdio>
int main() {
int a, b, X, vx, vy, vz;
scanf("%d%d%d%d%d%d", &a, &b, &X, &vx, &vy, &vz);
if (vx <= 0)
printf("impossible\n");
else {
double fx = X;
double t = fx / vx;
double sy = vy * t;
double sz = vz * t;
double yy=1;
double zz=1;
if(sy<0){
yy=-1;
sy=-sy;
}
if(sz<0){
zz=-1;
sz=-sz;
}
while (sy > (2 * a))
sy -= (2 * a);
while (sz > (2 * b))
sz -= (2 * b);
double ry, rz;
if (sy > (3 * a / 2)) {
ry = sy - a*2;
} else if (sy > a / 2) {
ry = a - sy;
} else {
ry = sy;
}
if (sz > (3 * b / 2)) {
rz = sz - b*2;
} else if (sz > b / 2) {
rz = b - sz;
} else {
rz = sz;
}
printf("%.3lf %.3lf %.3lf\n",fx ,ry*yy, rz*zz);
}
return 0;
}
分享到:
相关推荐
离散数学及其应用》,作者:罗森(Kenneth H.Rosen) ,这是第7版,2012年出版。这是经典的离散数学教材,为全球多所大学广为采用
本书是离散数学中最经典的教科书。现在许多名校都在用它作为离散数学的参考教材。英文原版更好
Fundamentals of Logic Design 6,7th Charles H.Roth经典书籍
Title: C++ Programming: From Problem Analysis to Program Design, 7th Edition Author: D. S. Malik Length: 1488 pages Edition: 7 Language: English Publisher: Course Technology Publication Date: 2014-02-...
7.4.4//H.323/409 7.5/提供多个等级的服务/410 7.5.1/启发研究的场景/411 7.5.2/调度和监管机制/414 7.5.3/区分服务/419 7.6/提供服务质量保证/423 7.6.1/一个有启发的例子/423 7.6.2/资源预约、呼叫准入、呼叫建立/...
英文版离散数学:Discrete Mathematics and Its Applications 7th Kenneth H.Rosen离散数学及其应用
Instructor's Solutions Manual for Discrete Mathematics by Kenneth H. Rosen 7th ed. It contains solutions for even exercises.
ContentsContentsWindows ... AuxKlibQueryModuleInformation functionBuffring.h Ioaccess.hREAD_PORT_UCHAR function READ_PORT_ULONG function READ_PORT_USHORT function READ_REGISTER_UCHAR function READ_
Detection and Measurement of Radar Signals: A Tutorial 7th Annual ISART Frank H. Sanders NTIA Institute for Telecommunication Sciences 1 March 2005
7th Gen Intel(R) Core(TM) processor family (Codename Kaby Lake) 8th Gen Intel(R) Core(TM) processor family (Codename Kaby Lake-R, Coffee Lake) 9th Gen Intel(R) Core(TM) processor family (Codename ...
离散数学及其应用 原书第6版(美)罗森 第六版中文版.pdf 教材答案:离散数学及其应用 原书第6版(美)罗森 第六版中文版 .pdf ...Discrete Mathematics and Its Applications 7th Edition 2011.pdf
书名(英文):Discrete Mathematics and Its Applications (7th Edition) 书名(中文):离散数学及其应用 (第七版) 原作者:Kenneth H.Rosen 【注】离散数学方面的经典教材。 书名(英文):Concrete ...
* added demux support for MKV "modern style" MPEG2, VC-1 and h264/AVC tracks * reading from (HD) DVD and Blu-Ray drives uses different reading APIs now * empty tracks in TS/m2ts container are not ...
截屏支持的设备 iPhone XiPhone 8iPhone 7iPhone SEiPhone 6siPhone 6iPhone 5siPad Pro (2015 & 2017 models)iPad 5th/6th/7th GenerationiPad Mini 4iPad Air 2iPad Air 1 (WiFi)iPad Mini 3iPad Mini 2 (WiFi)...
Amel Meddeb Makhlouf, University of the 7th of November at Carthage, Tunisia Noureddine Boudriga, University of the 7th of November at Carthage, Tunisia Chapter VII Peer-to-Peer (P2P) Network ...
H: Hacking For Dummies.pdf Hacking The Xbox 360 For Dummies.pdf Hacking Wireless Networks For Dummies.pdf Half Life 2 Mods For Dummies.pdf Ham Radio For Dummies.pdf HDTV For Dummies.pdf Healthy Aging...