Загрузить файлы в «/»

This commit is contained in:
2025-09-30 17:22:37 +03:00
parent 04f3343f0e
commit 8f3483480c
4 changed files with 154 additions and 133 deletions

View File

@@ -1,55 +1,19 @@
#include <iostream>
#include <clocale>
using namespace std;
int main() {
int c;
cout << "Menu:" << endl;
cout << "1. Income and delays -> lines of code" << endl;
cout << "2. Lines of code and desired salary -> delay" << endl;
cout << "3. Lines of code and delays -> salary" << endl;
cin >> c;
int l;
int t;
int s;
switch (c) {
case 1:
cout << "Enter the desired income ($): ";
cin >> s;
cout << "Enter the number of tardies: ";
cin >> t;
s += (t / 3) * 20;
l = (s / 50.0) * 100;
cout << "Vasyl needs to write " << l << " lines of code." << endl;
break;
case 2:
cout << "Enter the number of lines of code: ";
cin >> l;
cout << "Enter your desired salary ($): ";
cin >> s;
int b;
b = (l / 100) * 50;
cout << "Vasya can be late at most "
<< ((b - s) / 20) * 3 << " time(s)." << endl;
break;
case 3:
cout << "Enter the number of lines of code: ";
cin >> l;
cout << "Enter the number of tardies: ";
cin >> t;
s = (l / 100) * 50 - (t / 3) * 20;
if (s > 0)
cout << "Vasyl's salary: " << s << " $" << endl;
else
cout << "Vasya will not be paid anything." << endl;
break;
default:
cout << "Invalid choice." << endl;
}
return 0;
}
//#include <iostream>
//
//using namespace std;
//
//int main() {
// int k;
// k = 0;
// for (int i = 100; i <= 999; i++) {
// int a;
// a = i / 100;
// int b;
// b = (i / 10) % 10;
// int c;
// c = i % 10;
// if (a != b && a != c && b != c) k++;
// }
// cout << k << "\n";
// return 0;
//}