Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- #include <time.h>
- #include <stdlib.h>
- #define SPACE " "
- using namespace std;
- // Init Void
- void lignePleine(int n, char c);
- void ligneCreuse(int n, char c);
- void afficheCarre(int n, char c);
- int main(void)
- {
- afficheCarre(10, 'x');
- system("pause");
- return 0;
- }
- void lignePleine(int n, char c)
- {
- for (int i = 0; i < n; i++)
- {
- cout << c;
- }
- cout << endl;
- }
- void ligneCreuse(int n, char c)
- {
- cout << c;
- for (int i = 0; i < n - 2; i++)
- {
- cout << SPACE;
- }
- cout << c << endl;
- }
- void afficheCarre(int n, char c)
- {
- lignePleine(n, c);
- for (int i = 0; i < n - 2; i++)
- {
- ligneCreuse(n, c);
- }
- lignePleine(n, c);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement