about summary refs log tree commit diff
path: root/usth/ICT2.1/labwork/1/Ex1.cc
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-28 21:16:58 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-28 21:21:44 +0700
commit0887d8f96950a060a122e14ed2981182ff1eb37d (patch)
tree68be7a59c323c1fd901455ffae8f21874c4bb4c6 /usth/ICT2.1/labwork/1/Ex1.cc
parente461df7573c2b7b7e26c965d8cf2d8e175d67378 (diff)
downloadcp-0887d8f96950a060a122e14ed2981182ff1eb37d.tar.gz
[usth/ICT2.1] Algorithm and Data Structures
Diffstat (limited to 'usth/ICT2.1/labwork/1/Ex1.cc')
-rw-r--r--usth/ICT2.1/labwork/1/Ex1.cc28
1 files changed, 28 insertions, 0 deletions
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 <iostream>
+
+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;
+}