n条直线的最多交点

#include <iostream>
using namespace std;
int main()
{int i,n;
while(cin>>n)
{if(n==0||n==1) cout<<0;
if(n==2) cout<<"0 1";
if(n==3) cout<<"0 2 3";
if(n>3){
cout<<"0 "<<n-1<<" ";
for(i=2*(n-2);i<=n*(n-1)/2;i++)
cout<<i<<" ";
}
cout<<endl;
}
return 0;
}

posted @ 2015-07-19 10:20  NYNU_ACM  阅读(298)  评论(0编辑  收藏  举报