Cod sursa(job #2728139)
Utilizator | Data | 22 martie 2021 20:25:11 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char s,*p;
int n,litere=0,cuvinte=0,S;
void solve(){
while(in.get(s))
{
if(isalpha(s))
litere++;
else
{
if(litere>0)
cuvinte++;
S=S+litere;
litere=0;
}
}
out<<S/cuvinte;
}
int main(){
solve();
return 0;
}