Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct pizza
- {
- string nazwa;
- float srednica;
- float waga;
- };
- int ile;
- int main(int argc, char** argv)
- {
- cout <<"Ile pizz chcesz stworzyc: ";
- cin>>ile;
- pizza *w = new pizza [ile];
- for(int i=1; i<=ile; i++ )
- {
- cout <<"Podaj nazwe "<<i<<" pizzy: ";
- cin >>(w)[i-1].nazwa;
- cout <<"Podaj srednice (cm) "<<i<<" pizzy: ";
- cin >>(w)[i-1].srednica;
- cout <<"Podaj wage (dag) "<<i<<" pizzy: ";
- cin >>(w)[i-1].waga;
- cout <<endl;
- }
- cout <<"Stworzone pizze:" <<endl<<endl;
- for(int x=1; x<=ile; x++)
- {
- cout<<x<<". pizza:"<<endl;
- cout<<"Nazwa: "<<(w)[x-1].nazwa<<endl;
- cout<<"Srednica (cm): "<<(w)[x-1].srednica<<endl;
- cout<<"Waga (dag): "<<(w)[x-1].waga<<endl;
- cout<<endl;
- }
- delete [] w;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement