Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
165159 罗钰帆 数字金字塔 C++ Accepted 1 MS 272 KB 522 2026-11-12 18:51:10

Tests(8/8):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int i=1,j=1,a=1,d=1; cin>>i; a=i-1; for(int b=1;b<=i;b++){ for(int c=1;c<=a;c++) cout<<' '; for(int c=1;c<=d;c++) cout<<b; cout<<endl; a--; d+=2; } return 0; }