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

Commit

Permalink
fixed error esercizio server
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-cat-tty committed Oct 5, 2021
1 parent a6b0eae commit f1ff5ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Binary file modified esercitazioni/a.out
Binary file not shown.
9 changes: 5 additions & 4 deletions esercitazioni/download_from_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using namespace std;

int main() {
// [kb/s]
const int V1_MAX = 200, // if t <= 60 min
const int T1_MAX = 60*60,// seconds
V1_MAX = 200, // if t <= 60 min
V1_MIN = 50, // if t > 60 min
V2 = 100; // always
const int V1_MAX_TIME_SECONDS = 60*60;
Expand All @@ -13,8 +14,8 @@ int main() {
cout << "Dimensione film [kb]: ";
cin >> dim;

int t_v1_max = dim/V1_MAX;
if (t_v1_max <= 60)
int t_v1_max = dim/V1_MAX; // seconds
if (t_v1_max <= T1_MAX)
cout << "Server 1 in " << t_v1_max/60;
else {
int max_dim_v1_max = V1_MAX*V1_MAX_TIME_SECONDS;
Expand All @@ -26,7 +27,7 @@ int main() {
else
cout << "Server 2 in " << t_v2/60;
}
cout << endl;
cout << " minutes" << endl;

return 0;
}

0 comments on commit f1ff5ad

Please sign in to comment.