Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void PrintRectangle(int N, int K) {
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < K; j++) {
- if (i == 0 || i == N - 1 || j == 0 || j == K - 1) {
- cout << '*';
- }
- else {
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- int fact(int N) {
- int result = 1;
- for (int i = 1; i <= N; i++) {
- result *= i;
- }
- return result;
- }
- int main() {
- PrintRectangle(6, 15);
- int a = fact(5);
- cout << a << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment