Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

没地方保存,先借地方用一下

Posted by tanxiaohuagg at 2007-07-22 16:40:44 on Problem 1674
#include<stdio.h>
main()
{
int t,n,a[20],b[10000],temp,i,j,k,u=0;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&a[i]);
for(j=0;j<a[i];j++)scanf("%d",&b[j]);
}
for(i=0;i<t;i++)
{for(k=0;k<a[i];k++)
{for(j=i+1;j<a[i];j++)
if(a[j]==k+1)
{temp=b[i];
b[i]=a[j];
b[j]=temp;
u++;break;}
for(i=0;i<n;i++)if(b[i]==k+1)break;}
printf("%d\n",u);
}}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator