Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream plik("plik.txt");
- int dlugosc=0;
- char ch;
- if(plik.good())
- {
- while(!plik.eof())
- {
- plik >> ch;
- dlugosc++;
- }
- }
- plik.close();
- ifstream plik2("plik.txt");
- char * pobrane;
- pobrane = new char[dlugosc];
- int x=0;
- while(!plik2.eof())
- {
- plik2 >> pobrane[x];
- x++;
- }
- for(int i=0; i<dlugosc; i++)
- {
- cout << i << pobrane[i] << endl;
- if(pobrane[i]=='0' || pobrane[i]=='1' || pobrane[i]=='2' || pobrane[i]=='3' || pobrane[i]=='4' || pobrane[i]=='5' || pobrane[i]=='6' || pobrane[i]=='7' || pobrane[i]=='8' || pobrane[i]=='9')
- {
- if(pobrane[i+1]=='o')
- {
- cout << "odejmowanie: " << pobrane[i]-pobrane[i+6] << endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement