Cod sursa(job #2123232)
| Utilizator | Data | 5 februarie 2018 22:27:14 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
inline int litera(char c)
{ if(c>='a' && c<='z' ) return 1;
if(c>='A' && c<='Z' ) return 1;
return 0;
}
char a,b;
int l,nc;
int main(){
a=' ';
while(in.get(b))
{ if(litera(b)) l++;
else if(litera(a))nc++;
a=b;
}
if(!nc) out<<0<<"\n";
else
out<<l/nc<<"\n";
in.close();
out.close();
return 0;}
