Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- /*void potegi(int x)
- {
- int k[10];
- k[0] = x;
- for(int i = 1; i < 10; i++)
- k[i] = x * k[i-1];
- cout << k[5] << endl;
- }*/
- int main()
- {
- int k[10];
- int t[500];
- int x = 3;
- int n = 0;
- k[0] = x;
- for(int i = 1; i < 10; i++)
- k[i] = x * k[i-1];
- ifstream plik;
- plik.open("liczby.txt");
- for(int l = 0; l < 500; l++)
- plik >> t[l];
- while(n < 500)
- {
- if (t[n] == 1 || t[n] == k[0] || t[n] == k[1] || t[n] == k[2] || t[n] == k[3] || t[n] == k[4] || t[n] == k[5] || t[n] == k[6] || t[n] == k[7] || t[n] == k[8] || t[n] == k[9])
- cout << t[n] << endl;
- n++;
- }
- /* if( plik.good() )
- {cout << "ok" << endl;
- //INFO: plik udało się otworzyć
- } else
- {cout << "nie ok" << endl;
- //INFO: otwarcie pliku się nie powiodło
- } //else
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement