#13521: 答案


elvisliu (方塊)

學校 : 臺北市私立延平高級中學
編號 : 69054
來源 : [203.72.178.252]
最後登入時間 :
2018-12-19 17:05:19
d649. 數字三角形 -- 麗山高中迴圈36題 | From: [203.72.178.252] | 發表日期 : 2018-03-08 17:41

#include <iostream>
#include <stdlib.h>
using namespace std ;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int n;
while(cin>>n)
{
if(n==0) break;
for(int i=1; i<=n; i++)
cout<<string(n-i,'_')<<string(i,'+')<<'\n';
cout<<'\n';
}
return 0;
}

 
ZeroJudge Forum