Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <string>
- #include <cctype>
- using namespace std;
- int najczesciejWystepujacaLitera(const char * napis) {
- int ile = 0,ile2=0;
- char litera;
- for (int i = 0; i < int(strlen(napis)); i++) {
- for (int k = 1; k < int(strlen(napis)); i++) {
- if (tolower(*(napis+i)) == tolower(*(napis+k))) {
- ile++;
- }
- }
- if (ile > ile2) {
- litera = *(napis + i);
- ile2 = ile;
- }
- }
- return ile;
- }
- int main()
- {
- int wynik = najczesciejWystepujacaLitera("Ala Ma Kota");
- cout << wynik;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement