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 <cstring> using namespace std; char num1[11] = {"- -- -----"}; char num2[11] = {"| ||| ||"}; char num3[11] = {"||| | |||"}; char num4[11] = {" ----- --"}; char num5[11] = {"| | | | "}; char num6[11] = {"|| |||||||"}; char num7[11] = {"- -- -- --"}; int main() { int s; char str[20]; int len,i,j,digit,k; while(scanf("%d%s",&s,str)) { if(0 == s) break; len = strlen(str); for(i = 0; i < len; i++) { digit = str[i] - '0'; cout<<" "; for(j = 0; j < s; j++) { cout<<num1[digit]; } cout<<" "; } cout<<endl; for(j = 0; j < s; j++) { for(i = 0; i < len; i++) { digit = str[i] - '0'; cout<<num2[digit]; for(k = 0; k < s; k++) { cout<<" "; } cout<<num3[digit]; } cout<<endl; } for(i = 0; i < len; i++) { digit = str[i] - '0'; cout<<" "; for(j = 0; j < s; j++) { cout<<num4[digit]; } cout<<" "; } cout<<endl; for(j = 0; j < s; j++) { for(i = 0; i < len; i++) { digit = str[i] - '0'; cout<<num5[digit]; for(k = 0; k < s; k++) { cout<<" "; } cout<<num6[digit]; } cout<<endl; } for(i = 0; i < len; i++) { digit = str[i] - '0'; cout<<" "; for(j = 0; j < s; j++) { cout<<num7[digit]; } cout<<" "; } cout<<"\n\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