From 0887d8f96950a060a122e14ed2981182ff1eb37d Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 28 Dec 2019 21:16:58 +0700 Subject: [usth/ICT2.1] Algorithm and Data Structures --- usth/ICT2.1/labwork/1/Ex1.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 usth/ICT2.1/labwork/1/Ex1.cc (limited to 'usth/ICT2.1/labwork/1/Ex1.cc') diff --git a/usth/ICT2.1/labwork/1/Ex1.cc b/usth/ICT2.1/labwork/1/Ex1.cc new file mode 100644 index 0000000..da20f22 --- /dev/null +++ b/usth/ICT2.1/labwork/1/Ex1.cc @@ -0,0 +1,28 @@ +// Read two integers from stdin and print their sum and product +// This is free and unencumbered software released into the public domain. + +#include + +using namespace std; + +int +add (int& a, int& b) +{ + return a + b; +} + +int +mul (int& a, int& b) +{ + return a * b; +} + +int +main () +{ + int a; + int b; + + cin >> a >> b; + cout << add (a, b) << endl << mul (a, b) << endl; +} -- cgit 1.4.1