OOP HomeWork
This commit is contained in:
5
oop_hw1/oop_hw1_1/Func1.cpp
Normal file
5
oop_hw1/oop_hw1_1/Func1.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "func.h"
|
||||
|
||||
int f1(int num) {
|
||||
return g1(num * 2);
|
||||
}
|
8
oop_hw1/oop_hw1_1/Func2.cpp
Normal file
8
oop_hw1/oop_hw1_1/Func2.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "func.h"
|
||||
|
||||
int g1(int num) {
|
||||
return num * num;
|
||||
}
|
||||
int g2(int num) {
|
||||
return f1(num * 3);
|
||||
}
|
7
oop_hw1/oop_hw1_1/MyMain.cpp
Normal file
7
oop_hw1/oop_hw1_1/MyMain.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <iostream>
|
||||
#include "func.h"
|
||||
using namespace std;
|
||||
int main(int argc, char * argv[]) {
|
||||
cout << g2(10) << endl;
|
||||
return 0;
|
||||
}
|
9
oop_hw1/oop_hw1_1/func.h
Normal file
9
oop_hw1/oop_hw1_1/func.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#ifndef FUNC_H
|
||||
#define FUNC_H
|
||||
|
||||
int f1(int num);
|
||||
int g1(int num);
|
||||
int g2(int num);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user