Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int cyfry(string x)
- {
- int licznik=0;
- for(int i=0; i<x.length(); i++)
- {
- if(x[i]>47 && x[i]<58) licznik++;
- }
- return licznik;
- }
- int litery(string x)
- {
- int licznik=0;
- for(int i=0; i< x.length(); i++)
- {
- if(x[i]>64 && x[i]<91 || x[i]>96 && x[i]<123) licznik++;
- }
- return licznik;
- }
- int main()
- {
- int n;
- string x;
- cin >> n;
- cin.get();
- for(int i=0; i<n; i++)
- {
- getline(cin, x);
- cout << x.length() << " " << litery(x) << " " << cyfry(x) << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment