Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cout << "Iveskite kamuoliuku skaiciu: "; cin >> n;
- int ballCountSum = 0;
- for(int i = 1; i <= n; i++) {
- int ballPoint;
- cout << i << "-o kamuoliuko tasku kiekis: "; cin >> ballPoint;
- ballCountSum += ballPoint;
- }
- double ballsAverage = (double)ballCountSum / n;
- cout << "Is viso buvo galima surinkti tasku: " << n * 6 << endl;
- cout << "Tomas is viso surinko " << ballCountSum << " tasku" << endl;
- cout << "Jo tasku vidurkis: " << ballsAverage << " tasko" << endl;
- string wonType = (ballCountSum > (n * 6) / 2) ? "laimeta" : "pralaimeta";
- cout << "Loterija " << wonType << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement