Cod sursa(job #1524607)
Utilizator | Data | 14 noiembrie 2015 11:58:38 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
int n,i,s1,nr,c;
char s;
float ma;
s=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;
g<<ma;
}