Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <Windows.h>
- using namespace std;
- int main() {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- ofstream fout;
- fout.open("C:/Users/PC/Documents/student.txt");
- if (!fout.is_open()) {
- cout << "Ошибка открытия файла" << endl;
- }
- else {
- string str;
- cout << "Введите фамилию: ";
- cin >> str;
- fout << str << endl;
- cout << "Введите имя: ";
- cin >> str;
- fout << str << endl;
- cout << "Номер зачетной книжки: ";
- cin >> str;
- fout << str << endl;
- fout.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement