标签:NPU ios des 判断 i++ tput lse max 小数
题目
1 #include<iostream> 2 using namespace std; 3 int ans; 4 double a[100001],b[100001],p[100001][3]; 5 int main () 6 { 7 int n; 8 cin>>n; 9 double x,y; 10 int sb=0; 11 for (int i=1;i<=n;i++) 12 cin>>a[i]>>b[i]; 13 for (int i=1;i<=n;i++) 14 for (int j=i+1;j<=n;j++) 15 { 16 if (a[i]==0&&a[j]==0) continue; 17 if (a[i]==a[j]) 18 continue; 19 double l=a[i]-a[j]; 20 double r=b[j]-b[i]; 21 x=r/l; 22 y=a[i]*x+b[i]; 23 int f=0; 24 for (int k=1;k<=sb;k++) 25 { 26 if (p[k][1]==x&&p[k][2]==y) 27 { 28 f=1; break; 29 } 30 } 31 if (f==0) 32 { 33 sb++; 34 p[sb][1]=x; 35 p[sb][2]=y; 36 ans++; 37 } 38 39 } 40 if (ans==0) 41 cout<<"No Fire Point."; 42 else 43 cout<<ans; 44 }
标签:NPU ios des 判断 i++ tput lse max 小数
原文地址:https://www.cnblogs.com/zjzjzj/p/9692384.html