1 条题解

  • 0
    @ 2024-1-9 14:33:54
    #include<bits/stdc++.h>
    using namespace std;
    int main(){  //C++18级 八进制金字塔 
    	int a=4,h=5;
    	cin>>a>>h;
    	for(int i=1;i<=h;i++){
    		for(int j=0;j<h-i;j++){
    			cout<<"   ";
    		}
    		for(int j=1;j<=i;j++){
    			if(i!=1) 
    				a+=i;
    			printf("%-6o",a);
    			
    		}		
    		cout<<endl;
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    1167
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    (无)
    递交数
    16
    已通过
    11
    上传者