3172 - 直角三角形(星号)
如题
Input
Output
Examples
Input
no input needed
Output
* ** *** **** *****
Solution C
#include <stdio.h> #include <stdlib.h> int main() { printf("*\n"); printf("**\n"); printf("***\n"); printf("****\n"); printf("*****\n"); // system("pause"); return 0; }
Solution C++
#include<bits/stdc++.h> using namespace std; int n; int main() { for(int i=0;i<5;i++,cout<<endl) { for(int j=0;j<=i;j++) { cout<<"*"; } } return 0; }