From 2e38fdfe65dc5fe0ff207e1380d89c14776bf776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flavio=20Miccich=C3=A9?= Date: Thu, 19 Feb 2026 10:37:16 +0100 Subject: [PATCH 1/3] Add sum.cpp exercise --- exercises/sum.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/exercises/sum.cpp b/exercises/sum.cpp index 0dcca937..ad540a7a 100644 --- a/exercises/sum.cpp +++ b/exercises/sum.cpp @@ -6,3 +6,16 @@ Insert the second number: 2 Sum: 3 */ +#include +using namespace std; + +int main() { + int a = 0; + cout <<"insert the first number: "; + cin >> a; + int b = 0; + cout <<"insert the second number: "; + cin >> b; + int c = a + b; + cout << "La somma di " << a << " e " << b << " è: " << c << endl; return 0; +} \ No newline at end of file From ab18693e327c3eea6daea4097d203bb1f9b2f557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flavio=20Miccich=C3=A9?= Date: Sun, 22 Feb 2026 17:27:46 +0100 Subject: [PATCH 2/3] fix: replace tabs with spaces in sum.cpp --- exercises/sum.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/exercises/sum.cpp b/exercises/sum.cpp index ad540a7a..2b28aae3 100644 --- a/exercises/sum.cpp +++ b/exercises/sum.cpp @@ -1,21 +1,14 @@ -/* - Write a program that takes as input two numbers and print the sum. - - Output: - Insert the first number: 1 - Insert the second number: 2 - Sum: 3 -*/ #include using namespace std; int main() { - int a = 0; - cout <<"insert the first number: "; - cin >> a; - int b = 0; - cout <<"insert the second number: "; - cin >> b; - int c = a + b; - cout << "La somma di " << a << " e " << b << " è: " << c << endl; return 0; -} \ No newline at end of file +int a = 0; +cout <<"insert the first number: "; +cin >> a; +int b = 0; +cout <<"insert the second number: "; +cin >> b; +int c = a + b; +cout << "Sum: " << c << endl; +return 0; +} From da7e4cc4c575755ba4196e69a1df47f017c54329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flavio=20Miccich=C3=A9?= Date: Mon, 23 Feb 2026 11:26:45 +0100 Subject: [PATCH 3/3] fix: correct indentation in sum.cpp --- exercises/sum.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/sum.cpp b/exercises/sum.cpp index 2b28aae3..8ca730e1 100644 --- a/exercises/sum.cpp +++ b/exercises/sum.cpp @@ -2,13 +2,13 @@ using namespace std; int main() { -int a = 0; -cout <<"insert the first number: "; -cin >> a; -int b = 0; -cout <<"insert the second number: "; -cin >> b; -int c = a + b; -cout << "Sum: " << c << endl; -return 0; + int a = 0; + cout <<"insert the first number: "; + cin >> a; + int b = 0; + cout <<"insert the second number: "; + cin >> b; + int c = a + b; + cout << "Sum: " << c << endl; + return 0; }