Kashub's Code Barn - "Julka"

podświetlone jako div (dodał(a) Julka @ 2021-01-09 16:12:16)

Twoja wyszukiwarka
Parcel ABC
Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
 
#include <iostream>
#include <sstream>
#include <vector>
 
 
using namespace std;
 
 
void findInStr(CONST vector<string>& ListaZnakow, int& increment, CONST string& strToSearch){
 
    FOR(CONST auto& znak : ListaZnakow){
 
         size_t pos = 0;
 
        WHILE ((pos = strToSearch.find(znak,pos)) != STRING::npos){
            ++pos;
            ++increment;
         };
    }
 
}
 
 
INT main()
{
    STRING s,tekst = "";
    INT wiersze = 0;
    INT slowa = 0;
    INT ileZnakiBiale = 0;
    INT ileZnakiCzarne = 0;
 
    CONST vector<string> znakiBiale = {" "};
    CONST vector<string> nowaLinia = {"\n"};
    CONST vector<string> znakiCzarne = {"<",">","[","]"};
 
 
    WHILE(getline(cin,s),s!=""){
 
        tekst+=(s+"\n");
 
    }
 
    stringstream stekst(tekst);
 
    WHILE(!stekst.eof()){
 
        STRING slowo;
        stekst >> slowo;
 
        ++slowa;
 
    }
 
    findInStr(znakiBiale,ileZnakiBiale,stekst.str());
    findInStr(nowaLinia,wiersze,stekst.str());
    findInStr(znakiCzarne,ileZnakiCzarne,stekst.str());
 
    cout << "Slowa = " << --slowa << endl;
    cout << "Wiersze = " << wiersze << endl;
    cout << "Biale znaki = " << ileZnakiBiale << endl;
    cout << "Czarne znaki = " << ileZnakiCzarne << endl;
 
 
    RETURN 0;
}
| Sklepy internetowe | | Sklep z artykułami dla dzieci | | Foteliki samochodowe | | Opony całoroczne | | Opony letnie | | Programista PHP | | Skróć link | | Blog o książkach | | Przenieś bloga z onetu | | Kody programów |