6 条题解
-
4
#include <iostream> using namespace std; int main() { int i, j, n; char c; cin >> n; for (i = 1; i <= n; i = i + 1) { for (j = 1; j <= n - i; j += 1) { cout << " "; } for (j = 1; j <= 2 * i - 1; j += 1) { c = j + 64; cout << c; } cout << endl; } return 0; }//代码已AC
-
1
#include<iostream> using namespace std; int n; char a[27]={' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};//打表 int main(){ cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n-i;j++)//输出空格 cout<<" "; for(int j=1;j<=2*i-1;j++)//输出字母 cout<<a[j]; cout<<endl;//换行 } return 0; }//编者:Royal
- 1
信息
- ID
- 96
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 3
- 标签
- 递交数
- 182
- 已通过
- 92
- 上传者