Cod sursa(job #1213560)
| Utilizator | Data | 28 iulie 2014 15:26:44 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main(){
char s[100000],*p;
int litere=0,cuvinte=0,i;
in.get(s,100000);
in.get();
p=strtok(s," -");
while(p){
for(i=0;i<strlen(p);i++)
if( (p[i]>='A' && p[i]<='Z') || (p[i]>='a' && p[i]<='z') )
litere++;
cuvinte++;
p=strtok(NULL," -");
}
out<<litere/cuvinte;
}
