-
-
Save prodevo/f18ceb99f9f882c5301c6dc9db3ed08d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
const float P = 3.1415; | |
int r; | |
cout << "vvedit radius: "; | |
cin >> r; | |
cout << "S = " << r * r * P; | |
cout << "\nl = " << 2 * r * P; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int a = 1; | |
int b = 2; | |
int c = a; | |
a = b; | |
b = c; | |
} | |
int main1() | |
{ | |
int a = 1; | |
int b = 2; | |
a = a + b; | |
b = a - b; | |
a = a - b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "vvedit sumu(uah): "; | |
float s; | |
cin >> s; | |
int r = (s - int(s)) * 100 + 0.5; | |
cout << int(s) << " grn\t" << r << " kopijok"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "vvedit chas(sek): "; | |
int vvod; | |
cin >> vvod; | |
int d = vvod / 86400; | |
int h = (vvod % 86400) / 3600; | |
int m = (vvod % 3600) / 60; | |
int s = vvod % 60; | |
cout << d << " dniv, " << h << " hodyn, " << m << " hvylyn, " << s << " sekund"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int a; | |
int b; | |
cout << "vvedit pershe trycyfrove chyslo: "; | |
cin >> a; | |
cout << "vvedit druge trycyfrove chyslo: "; | |
cin >> b; | |
int mid_a = int((a / 10) % 10 * 10); | |
int mid_b = int((b / 10) % 10 * 10); | |
a = a - int((a / 10) % 10 * 10) + mid_b; | |
b = b - int((b / 10) % 10 * 10) + mid_a; | |
cout << a << '\n'; | |
cout << b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
int m; | |
int x; | |
int g; | |
cout << "k-ist kurok: "; | |
cin >> n; | |
cout << "cina kurky(grn): "; | |
cin >> m; | |
cout << "jajets z kurky na tyzhden: "; | |
cin >> x; | |
cout << "cina za 10 jajets(grn): "; | |
cin >> g; | |
int g_pdv = g - (g * 0.2); | |
int total_cost = n * m; | |
int per_day = (n * x / 7) * (g_pdv / 10); | |
int to_payoff = (total_cost / per_day) + 0.51; | |
cout << "okupnist: " << to_payoff << " dniv"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment