Cod sursa(job #1524612)
| Utilizator | Data | 14 noiembrie 2015 12:01:55 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
int n,i,s1,nr,c;
char s;
float ma;
s1=0;
nr=0;
c=0;
ifstream f("text.in");
ofstream g("text.out");
while(f.get(s)){
if(((s>='a')&&(s<='z'))||((s<='A')&&(s<='Z')))
{
s1=s1+1;
c=1;
}
else
if (c=1)
{
nr=nr+1;
c=0;
}
}
if(c=1)
nr=nr+1;
ma=s1/nr;
cout<<ma;
g<<ma;
}
