Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- char input;
- unsigned long long des_misto = 0;
- ifstream myFile;
- myFile.open("pi.txt");
- if (myFile.is_open()) {
- cout << "File has been detected." << endl;
- }
- else {
- cout << "Inicializace selhala. Soubor nenalezen." << endl;
- system("pause");
- return 0;
- }
- cout << "Ktere desetinne misto picka te zajima, gadzo?" << endl;
- cin >> des_misto;
- if (des_misto > 1000000){
- cout << "V databazi je pi na presnost 1 000 000 desetinnych mist." << endl;
- cout << "Ukoncuji program." << endl;
- system("pause");
- return 0;
- }
- cout << "3,";
- for (int i = 0; i < des_misto; i++){
- myFile >> input;
- cout << input;
- }
- myFile.close();
- cout << endl;
- system("pause");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment