본문 바로가기
C++/c++수업

p197 class 계산기

by sj0020 2020. 8. 18.
class FourCal:
    def setdata(self, first, second):
        self.first = first
        self.second = second
    def add(self):
        result = self.first + self.second
        return result
    def mul(self):
        result = self.first * self.second
        return result
    def sub(self):
        result = self.first - self.second
        return result
    def div(self):
        result = self.first / self.second
        return result

'C++ > c++수업' 카테고리의 다른 글

char string  (0) 2020.10.13
cout cin  (0) 2020.10.13
<iostream> cout <<  (0) 2020.10.13
volatile , type qualifiers(한정자)  (0) 2020.09.03
반지름입력받기 /원면적구하기  (0) 2020.07.30