Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int freq, amp, t, x = 1;
- cin >> t;
- cout << endl;
- for(int i = 1; i <= t; i++)
- {
- cin >> amp >> freq;
- x = 1;
- while(x <= freq)
- {
- for(int j = 1; j <= amp; j++)
- {
- for(int k = 0; k < j; k++)
- cout << j;
- cout << endl;
- }
- for(int m = amp - 1; m > 0; m--)
- {
- for(int k = 0; k < m; k++)
- cout << m;
- cout << endl;
- }
- if(x != freq) //blank line after each wave exept last one
- cout << endl;
- x++;
- }
- if(i % 2 == 0) //blank line after each 2 cases
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement