zoukankan      html  css  js  c++  java
  • hdu 3940

    #include<stdio.h>
    #include<math.h>
    #include<string.h>
    double first(double vx,double vy,double h) {
        return vx*(vy+sqrt(vy*vy+19.6*h))/9.8;
    }
    double nowh(double h,double vy,double t) {
        return h+vy*t-4.9*t*t;
    }
    int main() {
        double  k,h,vx,vy,v1,v2,v3,h1,h2,t;
        char s[30];
        while(scanf("%lf%s",&h,s)!=EOF) {
            if(strcmp(s,"Red")==0) {
                scanf("%lf%lf",&vx,&vy);
                printf("%.3f ",first(vx,vy,h));
                continue;
            }
                if(strcmp(s,"Yellow")==0) {
                scanf("%lf%lf%lf",&vx,&vy,&t);
              if(first(vx,vy,h)<vx*t) {
                 printf("%.3f ",first(vx,vy,h));
                 continue;
        }
            h1=nowh(h,vy,t);
            h2=vx*t;
            vy=vy-9.8*t;
            printf("%.3f ",h2+first(2*vx,2*vy,h1));
            continue;
                }
                if(strcmp(s,"Blue")==0){
                    scanf("%lf%lf%lf%lf%lf%lf",&vx,&vy,&t,&v1,&v2,&v3);
                    if(first(vx,vy,h)<vx*t) {
                    printf("%.3f ",first(vx,vy,h));
                    continue;
                    }
                     h1=nowh(h,vy,t);
                     h2=vx*t;
                     vy=vy-9.8*t;
        printf("%.3f %.3f %.3f ",h2+first(v1,vy,h1),h2+first(v2,vy,h1),h2+first(v3,vy,h1));
                }
        }
        return 0;
    }

    //一个博客地址帮助你理解http://blog.sina.com.cn/s/blog_c0519a300101dr2w.html

  • 相关阅读:
    微软首届Power Platform开发黑客松大赛
    PowerApps 简介
    PowerBI KPI 演示
    什么是Power Platform低代码
    利用Microsoft PowerApps模板,一分钟创建Service Desk服务程序
    Power Platform
    Microsoft Power Platform 低代码开发平台
    登录监听Enter键
    代理配置
    Enjoy the pain about Moloch
  • 原文地址:https://www.cnblogs.com/thefirstfeeling/p/4410999.html
Copyright © 2011-2022 走看看