- #include<iostream>
- using namespace std;
- void printWave(int amplitude)
- {
- for(int i = 1; i <= amplitude; i++){
- for(int ii = 1; ii <= i; ii++){
- cout<<i;
- }
- cout<<endl;
- }
- for(int j = amplitude-1; j >= 1; j--){
- for(int jj = 1; jj<=j ; jj++){
- cout<<j;
- }
- cout<<endl;
- }
- }
- int main ()
- {
- int cases , amp , freq;
- cin>>cases;
- for(int i=0 ; i<cases ; i++){
- if(i>0) cout<<endl;
- cin>>amp>>freq;
- for(int j=0 ; j<freq; j++){
- if(j>0)cout<<endl;
- printWave(amp);
- }
- }
- return 0;
- }
You can find more of my solutions on Here
No comments:
Post a Comment