Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication25.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- struct ksiazka
- {
- string tytul;
- string autor;
- float wartosc;
- };
- int main(void)
- {
- struct ksiazka bibl; // deklaracja obiektu bibl jako zmiennej |
- cout << "podaj tytul ksiazki. \n";
- setlocale(LC_ALL, "");
- getline(cin, bibl.tytul); //dostep do skladnika
- cout << "teraz podaj autora. \n";
- getline(cin, bibl.autor);
- setlocale(LC_ALL, "");
- cout << "teraz podaj wartość. \n";
- setlocale(LC_ALL, "");
- cin >> bibl.wartosc;
- cout << bibl.tytul << " autor: " << bibl.autor;
- setlocale(LC_ALL, "");
- cout << " wartość: ";
- setlocale(LC_ALL, "C");
- cout << bibl.wartosc << endl;
- setlocale(LC_ALL, "C");
- cout << bibl.autor << " " << bibl.tytul << " " << bibl.wartosc << endl;
- cout << "gotowe. \n";
- getchar();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement