| ||||||||||
| 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>
using namespace std;
const int K = 22;
char a[K][K];
int main()
{
int N;
int S;
int move = 1;
cin >> N >> S;
for (int i = 0;i < N;i++)
{
for (int j = 0;j < move;j++)
{
if (j > i)
{
a[j][i] = ' ';
}
else
{
if (S == 9)
{
a[j][i] = '9';
S = 1;
}
else
{
a[j][i] = S + '0';
S++;
}
}
}
move++;
}
for (int i = 0;i < N;i++)
{
for (int j = 0;j < N;j++)
{
cout << a[i][j];
if (j != N - 1)
cout << ' ';
}
cout << endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator