7 条题解

  • 4
    @ 2022-8-6 11:54:47
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		for(int k=1;k<=n;k++)
    		{
    			for(int j=1;j<=n-i;j++)
    			{
    				cout<<" ";
    			} 
    			for(int j=1;j<=i*2-1;j++)
    			{
    				cout<<"*";
    			} 
    			for(int j=1;j<=n-i;j++)
    			{
    				cout<<" ";
    			} 
    			cout<<" "; 
    		}	
    		cout<<endl;
    	}	
    	return 0; 
    }
    
    • 0
      @ 2023-12-19 16:27:29
      #include <iostream>
      using namespace std;
      const int INF = 0x3f3f3f3f;
      const int N = 1e5 + 10;
      
      int n;
      
      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 << "*";
      			
      		for(int j = 1; j <= n - 1; j++)
      		{
      			for(int k =1 ; k <= 2 * n - 1 - 2 * (i - 1); k++)
      				cout << " ";
      			for(int j = 1; j <= 2 * i - 1; j++)
      				cout << "*";
      		}
      		cout << endl;
      	}
      
          return 0;
      }
      
      • 0
        @ 2023-12-12 17:26:40

        #include<iostream> using namespace std; int main(){ int n, k, sum = 0; cin >> n; for(int i=1;i<=n;i++) { for(int k=1;k<=n;k++) { for(int j=1;j<=n-i;j++) { cout<<" "; } for(int j=1;j<=i2-1;j++) { cout<<""; } for(int j=1;j<=n-i;j++) { cout<<" "; } cout<<" "; } cout<<endl; } }

        • 0
          @ 2023-11-26 16:35:07

          #include <iostream>

          #include <iomanip>

          #include <cmath>

          using namespace std;

          int n;

          int main()

          {

          ** **cin>>n;

          ** **for(int i=1;i<=n;i++)

          ** **{

          ** **for(int j=1;j<=n-i;j++)

          ** **{

          ** **cout<<" ";

          ** **}

          ** **for(int k=1;k<=n;k++)

          ** **{

          ** *for(int j=1;j<=2i-1;j++)

          ** **{

          ** **cout<<"*";

          ** **}

          ** for(int j=1;j<=2n-2i+1;j++)

          ** **{

          ** **cout<<" ";

          ** **}

          ** **}

          ** **cout<<endl;

          ** **}

          ** **return 0;

          }

          • -2
            @ 2023-3-20 17:47:18
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
            	int n;
            	cin>>n;
            	for(int i=1;i<=n;i++)
            	{
            		for(int k=1;k<=n;k++)
            		{
            			for(int j=1;j<=n-i;j++)
            			{
            				cout<<" ";
            			} 
            			for(int j=1;j<=i*2-1;j++)
            			{
            				cout<<"*";
            			} 
            			for(int j=1;j<=n-i;j++)
            			{
            				cout<<" ";
            			} 
            			cout<<" "; 
            		}	
            		cout<<endl;
            	}	
            	return 0; 
            }
            
            • -3
              @ 2022-12-11 17:53:23

              #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int k=1;k<=n;k++){ for(int j=1;j<=n-i;j++)cout<<" "; for(int j=1;j<=i2-1;j++)cout<<""; for(int j=1;j<=n-i;j++)cout<<" "; cout<<" "; } cout<<endl; } return 0; }

              • -4
                @ 2022-7-6 10:34:28

                #include<stdio.h> #include<iostream> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { for(int k=1;k<=n;k++) { for(int j=1;j<=n-i;j++) cout<<" "; for(int j=1;j<=i2-1;j++) cout<<""; for(int j=1;j<=n-i;j++) cout<<" "; cout<<" "; } cout<<endl; } }

                • 1

                信息

                ID
                956
                时间
                1000ms
                内存
                128MiB
                难度
                4
                标签
                递交数
                356
                已通过
                171
                上传者