for循环作业2和3

#include<iostream>
using namespace std;
int main(){
	int i,j;
    for(i=1;i<=10;i++){
        for(j=1;j<=i;j++){
            cout<<"*";
        }
        cout<<endl;
        }
}

  

 

 

 

 

 

 

#include<iostream>
using namespace std;
int main(){
	int i,j;
    for(i=1;i<=10;i++){
        for(j=10;j>=i;j--){
            cout<<"*";
        }
        cout<<endl;
        }
}

  

posted @ 2017-10-12 19:57  羿龙  阅读(169)  评论(0编辑  收藏  举报