|
|
back to boardWHY WA#4???? WHY WA#4???? #include<stdio.h> #include<math.h> void main(){ int v=0,m,n; scanf("%d",&n); int* a=new int[n]; int* b=new int[n]; int* c=new int[n]; scanf("%d",&m); for (int i=1;i<=n;i++){ scanf("%d",&a[i]); } if(m+11<=n){ for(int j=m+1;j<=11+v;j++){ b[j]=a[j];} for(int j=m+1;j<=11+v;j++){ printf("%d",b[j]); } } else { v=m; while(v>n){ v=abs(v-n); } for(int i=v+1;i<=n;i++){ b[i]=a[i];} for(int k=1;k<=10-(n-v);k++){ c[k]=a[k];} for(int i=v+1;i<=n;i++){ printf("%d",b[i]); } for(int k=1;k<=10-(n-v);k++){ printf("%d",c[k]); } } } Re: WHY WA#4???? Your program always must output 10 digits. Try this test: 15 16 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 Re: WHY WA#4???? Thank you,Sergey Lazarev!=) |
|
|