zoukankan      html  css  js  c++  java
  • UVaLive 6628 Grachten (水题,数学)

    题意:给定一个平面图形并且且给了几条连,求一条。

    析:简单么,三角形相似,很简单就AC。

    代码如下:

    #pragma comment(linker, "/STACK:1024000000,1024000000")
    #include <cstdio>
    #include <string>
    #include <cstdlib>
    #include <cmath>
    #include <iostream>
    #include <cstring>
    #include <set>
    #include <queue>
    #include <algorithm>
    #include <vector>
    #include <map>
    #include <cctype>
    #include <stack>
    using namespace std;
    
    typedef long long LL;
    typedef pair<int, int> P;
    const int INF = 0x3f3f3f3f;
    const double inf = 0x3f3f3f3f3f3f;
    const double PI = acos(-1.0);
    const double eps = 1e-8;
    const int maxn = 10 + 5;
    const int mod = 1e9 + 7;
    const char *mark = "+-*";
    const int dr[] = {-1, 0, 1, 0};
    const int dc[] = {0, 1, 0, -1};
    int n, m;
    inline bool is_in(int r, int c){
        return r >= 0 && r < n && c >= 0 && c < m;
    }
    
    int main(){
        int ac, ab, bd;
        while(scanf("%d %d %d", &ab, &ac, &bd) == 3){
            int x = ab*ac;
            int y = bd-ac;
            int g = __gcd(x, y);
            printf("%d/%d
    ", x/g, y/g);
        }
        return 0;
    }
    

      

  • 相关阅读:
    utils04_搭建私有Git服务器
    utils03_clone远程仓库
    java 22
    java 22
    java 22
    java 22
    java 22
    java 22
    java 22
    java 22
  • 原文地址:https://www.cnblogs.com/dwtfukgv/p/5791587.html
Copyright © 2011-2022 走看看