zoj2741Offside

<a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1741" rel="noopener nofollow">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1741</a>只能用一个词来形容--“恶心”
数据里有double
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<sstream>
using namespace std;
struct node
{
    double x,y;
};
node change(string s)
{
    node a;
    int it=s.find(',');
    s[it]=' ';
    s[0]=' ';
    s[s.size()-1]=' ';
    istringstream bin(s);
    bin>>a.x>>a.y;
    return a;
}
int main()
{
    string s,ss;
    vector <node>  v;
    while(getline(cin,s))
    {
         
        v.clear();
        istringstream sin(s);
        while(sin>>ss)
        {
            v.push_back(change(ss));
             
        }
 
        int num=0;
        if(v[0].x<=0||v[0].x<=v[1].x){cout<<"PlayOn"<<endl;}
        else
        {
            for(int i=2;i<v.size();i++)
            {
                 if(v[0].x<=v[i].x)num++;
            }
            if(num>=2)cout<<"PlayOn"<<endl;
            else cout<<"Offside"<<endl;
        }
         
    }
}
posted on   4.5.6  阅读(177)  评论(0编辑  收藏  举报
编辑推荐:
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
阅读排行:
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法
点击右上角即可分享
微信分享提示