Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <iomanip>
- using namespace std;
- struct Mokinys
- {
- string pav;
- int kiek;
- };
- void Skaityti(Mokinys A[], int &n)
- {
- ifstream fd("duom.txt");
- fd >> n;
- for (int i = 0; i < n; i++)
- {
- fd >> A[i].pav >> A[i].kiek;
- }
- fd.close();
- }
- void Spausdinti(Mokinys A[], int n, string eil)
- {
- cout << eil << endl;
- cout << "________________________" << endl;
- cout << " Vardas Taškai " << endl;
- cout << "________________________" << endl;
- for (int i = 0; i < n; i++)
- {
- cout << " " << setw(15) << left << A[i].pav << " " << setw(10) << A[i].kiek << endl;
- cout << "________________________" << endl;
- }
- }
- void Atrinkti()
- {
- }
- void Suma()
- {
- }
- int main()
- {
- setlocale (LC_ALL, "Lithuanian");
- string eil = "Klasės mokinių sąrašas";
- int n = 0;
- Mokinys A;
- Skaityti(A, n);
- Spausdinti(A, n, eil);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement