Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- #include <string>
- #include <locale.h>
- int numer();
- using namespace std;
- char a[256];
- char Eilutes[50][256];
- string temp;
- int eNR =0;
- int sk = 0;
- ifstream fd("Tekstas.txt");
- ofstream fr("Rezultatai.txt");
- int main() {
- // 32 46 44
- int sMax = INT_MIN;
- setlocale(LC_ALL,"Lithuanian");
- while (!fd.eof()) {
- eNR++;
- fd.getline(a,256);
- strcpy(Eilutes[eNR],a);
- cout << Eilutes[eNR] << endl;
- }
- numer();
- cin >> eNR;
- return 0;
- }
- int numer () {
- for (int i = 1; i <= eNR; i++) {
- temp = Eilutes[i];
- sk = 0;
- for(int j = 0; j <= temp.size(); j++) {
- if((int)temp[j] == 32 || (int)temp[j] == 46 || (int)temp[j] == 44){
- sk++;
- }
- }
- fr << i << " eiluteje yra " << sk << " skyrikliu" << endl;
- cout << sk << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement