本文共 790 字,大约阅读时间需要 2 分钟。
题目1065:输出梯形#includeusing namespace std;#include int main(){ int h; while(cin >> h) { for(int i = 1; i <= h; i++) { cout << setfill(' ') << setw(2*(h-i) + 1); for(int j = 1; j <= h+2*i-2; j++) cout << "*"; cout << endl; } } return 0;}/************************************************************** Problem: 1065 User: true14fans Language: C++ Result: Accepted Time:160 ms Memory:1520 kb****************************************************************/
转载地址:http://cjwtb.baihongyu.com/