Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int tam = 1;
- void tamgiac(int a)
- {
- for (int count = 1; count <= a; count++)
- {
- for(int dem = 1; dem <= count; dem++) {
- cout << "*";
- cout << " ";
- }
- cout << endl;
- }
- }
- void tamgiacnguoc(int a)
- {
- for (int count = a; count >=1; count--)
- {
- for(int dem = count; dem >=1; dem--) {
- cout << "*";
- cout << " ";
- }
- cout << endl;
- }
- }
- void inmanhinh(int a)
- {
- for (int count = 1; count <= a; count++)
- {
- tam = 1;
- for(int dem = 1; dem <= count; dem++) {
- cout << tam;
- cout << " ";
- tam += 2;
- }
- cout << endl;
- }
- }
- int main()
- {
- tamgiacnguoc(10);
- inmanhinh(10);
- tamgiac(10);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement