Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- main()
- {
- ifstream fin("wyrazy.txt");
- int wynik=1;
- string tekst;
- while(!fin.eof())
- {
- getline(fin,tekst);
- if(tekst.size()>0)
- {
- for(int i=0;i<tekst.size();i++)
- {
- if(tekst[i]==' ')wynik++;
- }
- cout<<wynik<<endl;
- wynik=1;
- }
- else
- {
- wynik=0;
- cout<<wynik;
- }
- }
- fin.close();
- }
- #include <iostream>
- #include <fstream>
- using namespace std;
- main()
- {
- ifstream fin("dane.txt");
- ofstream fout("wynik.txt");
- int liczba1,liczba2,liczba3,iloczyn;
- while(!fin.eof())
- {
- fin>>liczba1>>liczba2>>liczba3;
- iloczyn=liczba1*liczba2*liczba3;
- if(iloczyn>=50&&iloczyn<=1000) fout<<iloczyn<<endl;
- }
- fin.close();
- fout.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement