Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
esercizi seconda lezione fatti
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-cat-tty committed Sep 28, 2021
1 parent 9e13e86 commit ef70c0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion esercitazioni/5_0_se_multiplo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ int main() {
cin >> a;
cout << "Inserisci secondo numero intero positivo: ";
cin >> b;
cout << n%2 << endl;
cout << (((a%b-1)*2+1)%2+1)/2 << endl;
return 0;
}
14 changes: 14 additions & 0 deletions esercitazioni/5_1_se_multiplo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
int a, b;
cout << "Inserisci primo numero intero positivo: ";
cin >> a;
cout << "Inserisci secondo numero intero positivo: ";
cin >> b;
cout << abs((((a%b-1)*2+1)%2-1)/2) << endl;
return 0;
}
Binary file modified esercitazioni/a.out
Binary file not shown.

0 comments on commit ef70c0f

Please sign in to comment.