题目1065:输出梯形

来源:互联网 发布:怎么入侵网站数据库 编辑:程序博客网 时间:2024/06/07 17:34

#include<iostream>#include<cstdio>#include<cstring>#include<cassert>using namespace std;int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int n2=n*3-2;        int n3=n*2-2;        for(int i=0;i<n;i++)        {            int j=0;            n3=n*2-2-i*2;            for(;j<n3;j++)            {                putchar(' ');            }            for(;j<n2;j++)            {                putchar('*');            }            putchar('\n');        }    }#ifdef _DEBUG    system("pause");#endif    return 0;}    /**************************************************************    Problem: 1065    User: cust123    Language: C++    Result: Accepted    Time:60 ms    Memory:1520 kb****************************************************************/


0 0
原创粉丝点击