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 |
测试都过了,一直WA,求拯救#include <iostream> #include <stdlib.h> #include <stdio.h> #include<string.h> using namespace std; char n1[]={"- -- -----"}; char n2[]={"| ||| ||"}; char n3[]={"||||| |||"}; char n4[]={" ----- --"}; char n5[]={"| | | |"}; char n6[]={"|| |||||||"}; char n7[]={"- -- -- --"}; int main(int argc,char**argv) { int s; int i,num,j; char n[20]; while(1) { cin>>s>>n; if(s==0)break; int len=strlen(n); for (i=0;i<len;i++) { cout<<' '; num=n[i]-'0'; for (j=0;j<s;j++) { cout<<n1[num]; } cout<<' '; cout<<' '; } cout<<endl; for (i=0;i<s;i++) { for (j=0;j<len;j++) { num=n[j]-'0'; cout<<n2[num]; for (int k=0;k<s;k++) { cout<<' '; } cout<<n3[num]; cout<<' '; } cout<<endl; } for (i=0;i<len;i++) { cout<<' '; num=n[i]-'0'; for (j=0;j<s;j++) { cout<<n4[num]; } cout<<' '; cout<<' '; } cout<<endl; for (i=0;i<s;i++) { for (j=0;j<len;j++) { num=n[j]-'0'; cout<<n5[num]; for (int k=0;k<s;k++) { cout<<' '; } cout<<n6[num]; cout<<' '; } cout<<endl; } for (i=0;i<len;i++) { cout<<' '; num=n[i]-'0'; for (j=0;j<s;j++) { cout<<n7[num]; } cout<<' '; cout<<' '; } cout<<endl; cout<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator