Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct donators
- {
- char surname[20];
- double donate;
- };
- int main()
- {
- int NumberOfDonators;
- std::cout << "Witaj w programie naszego towarzystwa! Podaj liczbe wplacajacych:\n";
- std::cin >> NumberOfDonators;
- std::cout << "Wspaniale! Bedziemy teraz prosic o podawanie kolejnych wplacajacych!\n";
- donators * GreatOnes = new donators [NumberOfDonators];
- for(int i = 0; i < NumberOfDonators; i++)
- {
- std::cout << "Prosze podac imie i nazwisko wplacajacego nr " << i+1 << ":\n";
- std::cin.ignore();
- std::cin.getline(GreatOnes[i].surname, 20);
- std::cout << "Prosze teraz podac ilosc, jaka wplacila ta osoba:\n";
- std::cin >> GreatOnes[i].donate;
- }
- std::cout << "NASI WSPANIALI SPONSORZY!\n";
- int j = 0;
- for(int i = 0; i < NumberOfDonators; i++)
- {
- if(GreatOnes[i].donate >= 10000)
- {
- j++;
- std::cout << GreatOnes[i].surname << "\n";
- }
- }
- if(j == 0)
- std::cout << "Brak.\n";
- std::cout << "NASI SPONSORZY:\n";
- int k = 0;
- for(int i = 0; i < NumberOfDonators; i++)
- {
- if(GreatOnes[i].donate < 10000)
- {
- std::cout << GreatOnes[i].surname << "\n";
- k++;
- }
- }
- if(k == 0)
- std::cout << "Brak.\n";
- delete [] GreatOnes;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment