⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 476 points in rectangles.cpp

📁 UVA Online Judge solutions to the problems
💻 CPP
字号:
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
    float a[15],b[15],c[15],d[15],x,y;
    int i=0;
    char s;
    while(cin>>s)
    {
                   if(s=='*')
                   break;
                   else
                   {
                       cin>>a[i]>>b[i]>>c[i]>>d[i];
                       i++;
                   }
    }
    int end=i,count=1;
    while(cin>>x>>y)
    {               
                    int flag=0;
                    if((10000-x)<=0.1 && (10000-y)<=0.1)
                    break;
                    
                    for(i=0;i<end;i++)
                    {
                                       if((x>a[i] && x<c[i]) && (y>d[i] && y<b[i]))
                                       {
                                       cout<<"Point "<<count<<" is contained in figure "<<i+1<<endl;
                                       flag=1;
                                       }
                                       
                    }
                    if(flag==0)
                    cout<<"Point "<<count<<" is not contained in any figure"<<endl;
    count++;
    }
system("pause");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -