| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
改了,还是reIn Reply To:Re:一个16行的程序 没有用指针 没有用除法 没有用函数 更没有用文件 怎么可能re?!!?!!?!?帮我 Posted by:wrong123 at 2006-02-26 00:56:20 #include<iostream.h>
int main()
{
int n,i,j,top,tot,t,tt,/*ans[1000],ansn(0),*/k,a[1000];
cin>>n;
for(i=0;i<n;i++)
{
cin>>top>>tot;t=0;
for(j=0;j<tot;j++)cin>>a[j];
for(j=0;j<tot;j++)
{
tt=a[j]-1;
for(k=top-j-1;k>=top-tot+1;k--)tt*=k;
t+=tt;
for(k=j+1;k<tot;k++)if(a[k]>a[j])a[k]--;
}
cout<<"Variace cislo "<<i+1<<" ma poradove cislo "<<t+1<<"."<<endl;
// ans[ansn]=t+1;ansn++;
}
// for(i=0;i<ansn;i++)cout<<"Variace cislo "<<i+1<<" ma poradove cislo "<<ans[i]<<"."<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator