Cod sursa(job #2289693)
Utilizator | Data | 25 noiembrie 2018 00:29:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <bits/stdc++.h>
using namespace std;
char c, l = '0';
int total, nr;
bool check(char x){
return ((x >= 'a' && x <='z') || (x>='A' && x<='Z'));
}
int main(){
ifstream cin ("text.in");
ofstream cout ("text.out");
while (cin >> noskipws >> c){
if (check(c) && !check(l)) nr++;
if (check(c)) total++;
l = c;
}
cout << total/nr;
return 0;
}