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 |
考虑再三决定出来贴下代码发泄下#include<iostream> using namespace std; char s[201]; int main() { int row,col,len,i,j,k; while(scanf("%d",&col)==1 && col!=0) { scanf(" %s",&s); len=strlen(s); row=len/col; for(i=0;i<col;i++) for(j=0,k=-i-1;j<row;j++) { if(j%2==0) k+=2*i+1; else k+=2*(col-i)-1; printf("%c",s[k]); } printf("\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator